<!DOCTYPE html>
<html xmlns:v-bind="http://www.w3.org/1999/xhtml" xmlns:v-on="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>合同新的详情页</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-store, must-revalidate">
    <meta http-equiv="expires" content="Wed, 26 Feb 1997 08:21:57 GMT">
    <meta http-equiv="expires" content="-1">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <link rel="shortcut icon" href="/dist/img/icon.png" type="image/x-icon">
    <!-- Bootstrap 3.3.6 -->
    <link rel="stylesheet" href="/dist/plugins/bootstrap/css/bootstrap.min.css">
    <!--&lt;!&ndash; Font Awesome &ndash;&gt;-->
    <link rel="stylesheet" href="/dist/css/font-awesome.min.css">
    <!--&lt;!&ndash; Ionicons &ndash;&gt;-->
    <link rel="stylesheet" href="/dist/css/ionicons.min.css">
    <!--OA主样式-->
    <link rel="stylesheet" href="/dist/css/OA.min.css?t=39cd89cd">
    <link rel="stylesheet" href="/dist/css/skins/OA-skins.min.css?t=16f1e6f3">
    <script src="https://file.ggxqce.com/web/vue.min.js"></script>
    <style>
        input::-webkit-outer-spin-button,
        input::-webkit-inner-spin-button {
            -webkit-appearance: none !important;
            margin: 0;
        }

        /*.bigTitle {*/
        /*height: 40px;*/
        /*padding: 6px 0;*/
        /*}*/

        .smallTitle {
            height: 20px;
            line-height: 20px;

            font-weight: bold;
            font-size: 14px;
        }

        .addPz {
            float: right;
            font-weight: normal;
            color: #4796e5;
            cursor: pointer;
        }

        .a-btn {
            cursor: pointer;
            font-size: 14px;
            right: 10px;
            margin-left: 9px;
            font-weight: bold;
        }

        .user:hover, .user.select {
            background-color: #cfd4d1;
        }

        .userbox .select.user {
            color: #fff;
            background-color: #045B9E;
        }

        .user {
            height: 30px;
            line-height: 30px;
            max-height: 30px;
            float: left;
            text-align: left;
            min-width: 32px;
            padding-left: 1px;
            overflow: hidden;
            cursor: pointer;
        }

        .selectBox .item {
            overflow: hidden;
            font-size: 12px;
            margin: 15px 0;
        }

        .selectBox .item .title {
            font-weight: bold;
            width: 105px;
            text-align: left;
            float: left;
        }

        .selectBox .item .boxCenter {
            float: left;
            margin-left: 50px;
        }

        .selectBox .item .boxCenter a {
            margin-right: 20px;
        }

        label {
            margin: 0;
            margin-right: 10px;
            font-weight: normal;
        }

        input[type=checkbox] {
            margin: 0;
            margin-top: 1px \9;
            float: left;
            line-height: normal;
            margin-top: 2px !important;
            margin-right: 2px !important;
        }

        input[type=radio] {
            margin: 0;
            margin-top: 1px \9;
            float: left;
            line-height: normal;
            margin-top: 6px !important;
            margin-right: 2px !important;
        }

        .contractDetail {
            font-size: 14px;
            line-height: 28px;
            font-family: 宋体;
        }

        /*合同样式*/
        .conTitle {
            font-family: 宋体;
            font-size: 20px;
            font-weight: bold;
            line-height: 2;
            margin: 0pt;
            orphans: 0;
            text-align: center;
            /*border-top: 1px solid #333;*/
            widows: 0;
        }

        .conTwoTitle {
            font-family: 宋体;
            font-size: 14px;
            font-weight: bold;
            font-size: 11pt;
            line-height: 150%;
            margin: 0pt;
            orphans: 0;
            text-align: right;
            overflow: hidden;

        }

        .conTwoTitleBox {
            float: right;
            width: 120px;
            text-align: left;
        }

        .conTable {
            border-collapse: collapse;
            margin: 0 0 0 auto;
            border-left: 1px solid #000000;
            border-top: 1px solid #000000;
            font-size: 14px;
            font-family: 宋体;
            table-layout: fixed
        }

        .conTable td {
            border-right: 1px solid #000000;
            border-bottom: 1px solid #000000;
        }

        .conTable .td-title {
            background-color: #bfbfbf;
            font-family: 宋体;
            font-size: 14px;
            /*font-weight: bold;*/
            height: 28px;
            vertical-align: middle;
            text-align: center;
        }

        .conTable .td-value {
            font-family: 宋体;
            font-size: 14px;
            line-height: 1.5;
            font-weight: bold;
            height: 28px;
            vertical-align: middle;
            text-align: left !important;
            color: red !important;
            padding: 0 6px !important;
        }

        .conTable .td-value span {
            margin-left: 2px;
        }

        .conIndent {
            text-indent: 28px;
        }

        .conIndent2 {
            text-indent: 49px;
        }

        .sign {
            margin-top: 10px;
            margin-bottom: 20px;
        }

        .sign .item {
            height: 28px;
            line-height: 28px;
        }

        .sign .title {
            text-align: right;
        }

        .sign .left {
            float: left;
            margin-left: 28px;
        }

        .sign .right {
            float: left;
            margin-left: 200px;
        }

        .confidentiality {
            font-weight: bold;
        }

        .confidentiality .right {
            margin-right: 200px;
            width: 300px;
            text-align: center;
            float: right;
        }

        .confidentiality .line {
            border: 2px dashed #333;
        }

        .sign .title {
            float: left;
        }

        .sign .value {
            float: left;
            width: 200px;
            border-bottom: 1px solid #333;
            height: 28px;
            margin-left: 5px;
        }

        .selectModel {
            border: none;
            border-bottom: 1px solid red;
            color: red;
            text-align: left;
        }

        .table-detail input[type=text], .table-detail input[type=number] {
            padding: 0 !important;
        }

        .vEdit[contenteditable=true] {
            user-modify: read-write-plaintext-only;
        }

        .vEdit:empty:before {
            content: attr(placeholder);
            display: block;
            color: #ccc;
        }

        .vEdit {
            height: 100%;
            min-width: 100%;
            line-height: 28px;
            min-height: 30px;
            display: inline-block;
            text-indent: 0px;
            word-break: break-all;
            outline: none;
            user-select: text;
            white-space: pre-wrap;
            text-align: left;

            vertical-align: middle;
        }

        .smallEdit1 {
            line-height: 36px;
            color: red;
        }

        .smallEdit {
            line-height: 1;
            border-bottom: 1px solid red;
            color: red;
        }

        .btn-info {
            background-color: #4796e5;
            border-color: #4796e5;
        }

        span.lineOne {
            line-height: 28px;
            height: 28px;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 1;
        }

        .div-td-content-more {
            position: absolute;
            height: auto;
            z-index: 999;
            line-height: 20px;
            background-color: #d3e8fd;
            padding: 8px 6px;
            border: 1px solid #e8e8ea;
            display: none;
        }

        .div-td-content-more i {
            width: 15px;
            height: 12px;
            background: url("/dist/img/more-icon.png");
            position: absolute;
            left: 50px;
            top: -12px;
        }

        .table-detail td.twoLine {
            line-height: 1.5 !important;
            padding: 3px 0 !important;
        "
        }

        .table-detail select {
            text-indent: 0 !important;
            padding-left: 0 !important;
            margin-left: -4px !important;
        }

        select {
            height: 24px;
            line-height: 24px;
            width: 91%;
            font-family: 宋体;
            font-size: 14px;
            vertical-align: middle;
            text-align: left !important;
            color: red !important;
            padding: 0 6px !important;
            text-indent: 0 !important;
            padding-left: 0 !important;
            margin-left: -4px !important;
        }

        .jiaobiao3 {
            position: relative;
        }

        .jiaobiao3 i {
            display: block;
            width: 10px;
            height: 10px;
            background: url("/dist/img/newLog3.png");
            position: absolute;
            top: 0px;
            right: 0px;
        }

        .moreListData {
            position: absolute;
            top: 30px;
            z-index: 111;
            display: none;
        }

        .moreListData .item {
            width: 100%;
            height: 30px;
            line-height: 30px;
        }

        .moreListData .item span {
            margin-right: 5px;
        }

        .ui_main {
            vertical-align: top;
        }

        ::-webkit-input-placeholder { /* WebKit browsers */
            color: gray;
            font-weight: normal;
        }

        ::-moz-placeholder { /* Mozilla Firefox 19+ */
            color: gray;
            font-weight: normal;
        }

        :-ms-input-placeholder { /* Internet Explorer 10+ */
            color: gray;
            font-weight: normal;
        }
    </style>
</head>
<body>
<!-- Content Header (Page header) -->
<section class="content" id="app">
    <div class="div-td-content-more"><i></i></div>
    <div class="oaLoad">
        <div class="loadGif" id="areaProgress"></div>
    </div>
    <iframe id="ifSave" style="display: none" src=""></iframe>
    <div class="model-picker-dropdown">
        <div class="model-select-wrap">
            <div class="model-select-tab">
                <a class="active" data-count="type">省</a><a class="" data-count="brand">市</a>
            </div>
            <div class="model-select-content">
                <div class="model-select type" data-count="type" style="display: block;">
                    <dl class="clearfix">
                        <a class="" :attr-id="item.id" v-for="item in provinceList">{{item.name}}</a>
                    </dl>
                </div>
                <div class="model-select brand" data-count="province">
                    <dl class="clearfix">
                        <a class="" :attr-id="item.id" v-for="(item,i) in cityList">{{item.name}}</a>
                    </dl>
                </div>
            </div>
        </div>
    </div>
    <div class="contract">
        <!--内容-->
        <div class="contractDetail" style="width: 80%;float:left;" v-cloak>
            <!--买卖双方及担保方信息-->
            <template>
                <div class="conTitle">销售合同</div>
                <div class="conTwoTitle">合<span style="margin:0 8px;">同</span>号：
                    <span class="conTwoTitleBox" style="color: red;width: 170px" v-if="!contract.main.contractNo">
                      合同创建成功后自动生成
                  </span>
                    <span style="color:red;height: 22px;width: 170px" v-else
                          class="conTwoTitleBox">{{contract.main.contractNo}}</span>
                </div>
                <div class="conTwoTitle">制作时间：
                    <span class="conTwoTitleBox"
                          style="color:red;letter-spacing: 1px;width: 170px"
                          v-if="pageType!='look'">{{today}}</span>
                    <span v-else style="color:red;height: 22px;letter-spacing: 1px;width: 170px"
                          class="conTwoTitleBox">{{dayFormat(contract.main.createTime)}}</span>
                </div>
                <div class="conTwoTitle">签署地点：
                    <span class="conTwoTitleBox"
                          style="color:red;letter-spacing: 1px;width: 170px">{{contract.main.city}}</span>
                </div>
                <div class="bigTitle" v-if="buyType=='全款'||contractType=='2'">一、买卖双方信息：</div>
                <div class="bigTitle" v-else>一、买卖双方及担保方信息：</div>
                <table class="conTable table-detail" cellspacing="0" cellpadding="0">
                    <tr>
                        <td class="td-title" style="width: 15%;">卖方</td>
                        <td class="td-value" style="width: 35%;">
                            <span>{{contract.main.seller}}</span>
                        </td>
                        <td class="td-title " style="width: 15%;">
                            买方(公司名称)
                        </td>
                        <td class="td-value" style="width: 35%;">
                            <input v-if="pageType!='look'" type="text" id="buyer"
                                   v-model="contract.main.buyer" v-on:click.stop="inputFocus('buyer')"/>
                            <span v-else>{{contract.main.buyer}}</span>
                        </td>
                    </tr>
                    <tr>
                        <!--<td>税号</td>
                        <td class="td-value">{{contract.main.sellerTaxNo}}</td>-->
                        <td class="td-title" style="position: static;">地址</td>
                        <td class="td-value"><span>{{contract.main.sellerAddress}}</span></td>
                        <td class="td-title">身份证号(公司税号)</td>
                        <td class="td-value">
                            <input type="text" v-if="pageType!='look'"
                                   v-model="contract.main.buyerTaxNo"/>
                            <span v-else>{{contract.main.buyerTaxNo}}</span>
                        </td>
                    </tr>
                    <tr>
                        <td class="td-title">联系电话</td>
                        <td class="td-value">{{contract.main.sellerTel}}</td>
                        <td class="td-title">地址</td>
                        <td class="td-value">
                            <input type="text" v-if="pageType!='look'"
                                   v-model="contract.main.buyerAddress"/>
                            <span v-else>{{contract.main.buyerAddress}}</span>
                        </td>
                    </tr>
                    <tr>
                        <td class="td-title">传真</td>
                        <td class="td-value">{{contract.main.sellerFax}}</td>
                        <td class="td-title">联系电话</td>
                        <td class="td-value">
                            <input type="text" v-if="pageType!='look'"
                                   v-model="contract.main.buyerTel"/>
                            <span v-else>{{contract.main.buyerTel}}</span>
                        </td>
                    </tr>
                </table>
                <template v-if="buyType!='全款'&&contractType!='2'">
                    <div style="height: 28px;position: relative;width: 100%;line-height: 20px;">
                        <span v-if="pageType!='look'"
                              style="position: absolute;right: 0px;top:2px;text-align: center">
                                    <a class="a-btn"
                                       @click="addRow('guarantorList','guarantorTem')">增加担保方</a>
                                     <a class="a-btn"
                                        @click="delRow('guarantorList')">删除担保方</a>
                        </span>
                    </div>
                    <table class="conTable table-detail" cellspacing="0" cellpadding="0"
                           v-for="(item,i) in contract.guarantorList">
                        <tr>
                            <td class="td-title twoLine" style="width: 15%;">

                                担保方({{getNumber('',i+1)}})</br>(公司名称)
                            </td>
                            <td class="td-value" style="width: 85%;">
                                <input type="text" v-if="pageType!='look'"
                                       v-model="item.guarantor"/>
                                <span v-else>{{item.guarantor}}</span>
                            </td>
                        </tr>
                        <tr>
                            <td class="td-title twoLine">身份证号(公司税号)</td>
                            <td class="td-value">
                                <input type="text" v-if="pageType!='look'"
                                       v-model="item.guarantorTaxNo"/>
                                <span v-else>{{item.guarantorTaxNo}}</span>
                            </td>
                        </tr>
                        <tr>
                            <td class="td-title">地址</td>
                            <td class="td-value">
                                <input type="text" v-if="pageType!='look'"
                                       v-model="item.guarantorAddress"/>
                                <span v-else>{{item.guarantorAddress}}</span>
                            </td>
                        </tr>
                        <tr>
                            <td class="td-title">联系电话</td>
                            <td class="td-value">
                                <input type="text" v-if="pageType!='look'"
                                       v-model="item.guarantorTel"/>
                                <span v-else>{{item.guarantorTel}}</span>
                            </td>
                        </tr>
                    </table>
                </template>
            </template>

            <!--新机-->
            <template v-if="contractType=='1'">
                <!--设备及付款信息-全款-->
                <template v-if="buyType=='全款'">
                    <div class="bigTitle">二、产品及商务条件：
                    </div>
                    <table class="conTable table-detail" cellspacing="0" cellpadding="0">
                        <tr>
                            <td class="td-title" style="width: 15%;">品牌</td>

                            <td class="td-value" style="width: 35%;">
                                <select v-model="contract.main.brandId" v-if="pageType!='look'" @change="changeBrand">
                                    <option value=""></option>
                                    <option v-for="(item,i) in brandList" v-bind:value="item.id">
                                        {{item.brandName}}
                                    </option>
                                </select>
                                <span v-else>{{contract.main.brandName}}</span>
                            </td>
                            <td style="width: 15%;" class="td-title">制造商</td>

                            <!--  <td class="td-value" style="width: 35%;">
                                  {{contract.main.manufacturer}}
                              </td>-->
                            <td class="td-value" style="width: 35%;">
                                <select v-if="pageType!='look'" v-model="contract.main.manufacturer">
                                    <option value=""></option>
                                    <option v-for="(item,i) in brandOtherList" v-bind:value="item.manufacturingCompany">
                                        {{item.manufacturingCompany}}
                                    </option>
                                </select>
                                <span v-else>{{contract.main.manufacturer}}</span>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 15%;" class="td-title">型号</td>

                            <td class="td-value" style="width: 35%;">
                                <select v-if="pageType!='look'" v-model="modelMessage" @change="changeModel">
                                    <option value=""></option>
                                    <option v-for="(item,i) in modelList" v-bind:value="item">
                                        {{item.modelName}}
                                    </option>
                                </select>
                                <span v-else>{{contract.main.modelName}}</span>
                            </td>
                            <td style="width:15%;" class="td-title">设备类型</td>

                            <td class="td-value" style="width: 35%;">
                                {{contract.main.deviceType}}
                            </td>

                        </tr>
                        <tr>
                            <td style="width: 15%;" class="td-title">序列号</td>
                            <td class="td-value" style="width: 35%;">
                                {{contract.main.serialNo?contract.main.serialNo:"销售出库后自动带出"}}
                            </td>
                            <td class="td-title">数量</td>
                            <td class="td-value">
                                <span>{{contract.sales.dealNo}}</span>
                            </td>
                        </tr>
                        <tr>
                            <td class="td-title">单价</td>

                            <td class="td-value">
                                <input v-if="pageType!='look'" type="text"
                                       @blur="strFormat($event.target,'contract.sales.unitPrice')"
                                       @focus="strFormatF($event.target,'contract.sales.unitPrice')"
                                       v-onedate="fmoney(contract.sales.unitPrice)"/>
                                <span v-else>{{fmoney(contract.sales.unitPrice)}}</span>
                                <span style="color: red;position:absolute;left:105px;top: 4px;">元</span>
                            </td>
                            <td class="td-title">不含税金额</td>
                            <td class="td-value">
                                <span>{{fmoney((contract.sales.unitPrice/1.13))}}</span>
                                <span style="color: red;position:absolute;left:105px;top: 4px;">元</span>
                            </td>
                        </tr>
                        <tr>
                            <td class="td-title">增值税税额（13%）</td>
                            <td class="td-value">
                                <span>{{fmoney((contract.sales.unitPrice-(contract.sales.unitPrice/1.13)))}}</span>
                                <span style="color: red;position:absolute;left:105px;top: 4px;">元</span>
                            </td>
                            <td class="td-title">总价</td>

                            <td class="td-value">
                                <span>{{getSalesTotalPrice}}</span>
                                <span style="color: red;position:absolute;left:105px;top: 4px;">元</span>
                            </td>
                        </tr>
                        <!--<tr>-->
                        <!--<td style="width: 15%;">其他费用</td>-->
                        <!--<td class="td-value" style="width: 75%;" colspan="3">-->
                        <!--<input v-if="pageType!='look'" type="text"-->
                        <!--@blur="strFormat($event.target,'contract.sales.otherCharge')"-->
                        <!--@focus="strFormatF($event.target,'contract.sales.otherCharge')"-->
                        <!--v-onedate="fmoney(contract.sales.otherCharge)"/>-->
                        <!--<span v-else>{{fmoney(contract.sales.otherCharge)}}</span>-->
                        <!--<span style="color: red;position:absolute;left:105px;top: 4px;">元</span>-->
                        <!--</td>-->
                        <!--</tr>-->
                        <!--<tr>-->
                        <!--<td class="td-title" style="width: 15%;">合计</td>-->
                        <!--<td class="td-value" style="width: 85%;" colspan="3">-->
                        <!--<span>{{getSalesTotal}}</span>-->
                        <!--<span style="color: red;position:absolute;left:105px;top: 4px;">元</span>-->
                        <!--<span style="color: #bbb;position:absolute;left:125px;top: 4px;">(总价+其他费用)</span>-->
                        <!--</td>-->
                        <!--</tr>-->
                        <tr v-if="pageType!='look'||(pageType=='look'&&contract.sales.priceOffer&&contract.sales.priceOffer!='无')">
                            <td class="td-title" style="width: 15%;">价格优惠说明</td>
                            <td colspan="3" class="td-value">
                                <input type="text" v-if="pageType!='look'"
                                       v-model="contract.sales.priceOffer" placeholder="单价已享受X万抵X万的展会优惠政策、其他优惠等"/>
                                <span v-else>{{contract.sales.priceOffer}}</span>
                            </td>
                        </tr>
                        <tr v-if="pageType!='look'||(pageType=='look'&&contract.sales.exhibitionGift&&contract.sales.exhibitionGift!='无')">
                            <td class="td-title" style="width: 15%;">展会配件赠送</td>
                            <td colspan="3" class="td-value">
                                <input type="text" v-if="pageType!='look'"
                                       @blur="strFormat($event.target,'contract.sales.exhibitionGift')"
                                       @focus="strFormatF($event.target,'contract.sales.exhibitionGift')"
                                       v-onedate="fmoney(contract.sales.exhibitionGift)"/>
                                <span v-else>{{contract.sales.exhibitionGift}}</span>
                                <span v-if="pageType!='look'" style="color: red;position:absolute;left:105px;top: 4px;">元（{{number2chinese(contract.sales.exhibitionGift)}}）常规保养件</span>
                            </td>
                        </tr>
                        <tr v-if="pageType!='look'||(pageType=='look'&&contract.sales.accessoryGift&&contract.sales.accessoryGift!='无')">
                            <td class="td-title" style="width: 15%;line-height: 1.6;">其他配件赠送<br>（按金额）</td>
                            <td class="td-value" colspan="3">
                                <template v-if="pageType!='look'">
                                    <input type="text" @blur="strFormat($event.target,'contract.sales.accessoryGift')"
                                           @focus="strFormatF($event.target,'contract.sales.accessoryGift')"
                                           v-onedate="fmoney(contract.sales.accessoryGift)"/>
                                </template>
                                <span v-else>{{contract.sales.accessoryGift}}</span>
                                <span v-if="pageType!='look'"
                                      style="color: red;position:absolute;left:105px;top: 4px;    line-height: 2.5">元（{{number2chinese(contract.sales.accessoryGift)}}）常规保养件</span>
                            </td>
                        </tr>
                        <tr v-if="pageType!='look'||(pageType=='look'&&contract.sales.accessoryGiftHour&&contract.sales.accessoryGiftHour!='无')">
                            <td class="td-title" style="width: 15%;line-height: 1.6;">其他配件赠送<br>（小时数）</td>
                            <td colspan="3" class="td-value" style="line-height: 1.6">
                                <input type="text" v-if="pageType!='look'"
                                       @blur="strFormat($event.target,'contract.sales.accessoryGiftHour')"
                                       @focus="strFormatF($event.target,'contract.sales.accessoryGiftHour')"
                                       v-onedate="fmoney(contract.sales.accessoryGiftHour)"
                                       placeholder="填写数字" style="width: 103px"/>
                                <input v-if="pageType!='look'" type="text" v-model="accessoryGiftHourOther"
                                       placeholder="补充说明" style="width: 50%;position: absolute;left: 193px;"/>
                                <span v-else>{{contract.sales.accessoryGiftHour}}</span>
                                <span v-if="pageType!='look'"
                                      style="color: red;position:absolute;left:105px;top: 4px;line-height: 2.7;">小时内保养件</span>
                            </td>
                        </tr>
                        <tr v-if="pageType!='look'||(pageType=='look'&&contract.sales.otherGifts&&contract.sales.otherGifts!='无')">
                            <td class="td-title" style="width: 15%;line-height: 1.6;">其他赠送</td>
                            <td colspan="3" class="td-value">
                                <input type="text" v-if="pageType!='look'" placeholder="如赠送原厂/副厂破碎锤管路、铲斗、礼品、保险等"
                                       v-model="contract.sales.otherGifts"/>
                                <span v-else>{{contract.sales.otherGifts}}</span>
                            </td>
                        </tr>
                    </table>
                    <div class="conIndent">1、买方采用全款方式购买，在卖方设备到达买方指定地点前一次性结清所有款项。</div>
                    <div class="conIndent">2、如果买方发生款项逾期时，需按月利率2%，不足整月按日利率0.07%支付给卖方逾期利息。</div>
                </template>
                <!--设备及付款信息-分期-->
                <template v-if="buyType=='内部分期'">
                    <div class="bigTitle"><span
                            style="float:left;">二、产品及商务条件：</span>
                    </div>
                    <table class="conTable table-detail" cellspacing="0" cellpadding="0">
                        <tr>
                            <td class="td-title" style="width: 15%;">品牌</td>
                            <td class="td-value" style="width: 35%;">
                                <select v-model="contract.main.brandId" v-if="pageType!='look'" @change="changeBrand">
                                    <option value=""></option>
                                    <option v-for="(item,i) in brandList" v-bind:value="item.id">
                                        {{item.brandName}}
                                    </option>
                                </select>
                                <span v-else>{{contract.main.brandName}}</span>
                            </td>
                            <td style="width: 15%;" class="td-title">制造商</td>

                            <!--  <td class="td-value" style="width: 35%;">
                                  {{contract.main.manufacturer}}
                              </td>-->
                            <td class="td-value" style="width: 35%;">
                                <select v-if="pageType!='look'" v-model="contract.main.manufacturer">
                                    <option value=""></option>
                                    <option v-for="(item,i) in brandOtherList" v-bind:value="item.manufacturingCompany">
                                        {{item.manufacturingCompany}}
                                    </option>
                                </select>
                                <span v-else>{{contract.main.manufacturer}}</span>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 15%;" class="td-title">型号</td>
                            <td class="td-value" style="width: 35%;">
                                <select v-if="pageType!='look'" v-model="modelMessage" @change="changeModel">
                                    <option value=""></option>
                                    <option v-for="(item,i) in modelList" v-bind:value="item">
                                        {{item.modelName}}
                                    </option>
                                </select>
                                <span v-else>{{contract.main.modelName}}</span>
                            </td>
                            <td style="width:15%;" class="td-title">设备类型</td>
                            <td class="td-value" style="width: 35%;">
                                {{contract.main.deviceType}}
                            </td>

                        </tr>
                        <tr>
                            <td style="width: 15%;" class="td-title">序列号</td>
                            <td class="td-value" style="width: 35%;">
                                {{contract.main.serialNo?contract.main.serialNo:"销售出库后自动带出"}}
                            </td>
                            <td class="td-title">数量</td>
                            <td class="td-value">
                                <span>{{contract.sales.dealNo}}</span>
                            </td>
                        </tr>
                        <tr>
                            <td class="td-title">单价</td>
                            <td class="td-value">
                                <template v-if="pageType!='look'">
                                    <input type="text" @blur="strFormat($event.target,'contract.sales.unitPrice')"
                                           @focus="strFormatF($event.target,'contract.sales.unitPrice')"
                                           v-onedate="fmoney(contract.sales.unitPrice)"/>
                                </template>
                                <span v-else>{{fmoney(contract.sales.unitPrice)}}</span>
                                <span style="color: red;position:absolute;left:105px;top: 4px;">元</span>
                            </td>
                            <td class="td-title">不含税金额</td>
                            <td class="td-value">
                                <span>{{fmoney((contract.sales.unitPrice/1.13))}}</span>
                                <span style="color: red;position:absolute;left:105px;top: 4px;">元</span>
                            </td>
                        </tr>
                        <tr>
                            <td class="td-title">增值税税额（13%）</td>
                            <td class="td-value">
                                <span>{{fmoney((contract.sales.unitPrice-(contract.sales.unitPrice/1.13)))}}</span>
                                <span style="color: red;position:absolute;left:105px;top: 4px;">元</span>
                            </td>
                            <td class="td-title">总价</td>
                            <td class="td-value">
                                <span>{{getSalesTotalPrice}}</span>
                                <span style="color: red;position:absolute;left:105px;top: 4px;">元</span>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 15%;" class="td-title">GPS费</td>
                            <td class="td-value" style="width: 35%;">
                                <input v-if="pageType!='look'" type="text"
                                       @blur="strFormat($event.target,'contract.sales.gpsCharge')"
                                       @focus="strFormatF($event.target,'contract.sales.gpsCharge')"
                                       v-onedate="fmoney(contract.sales.gpsCharge)"/>
                                <span v-else>{{fmoney(contract.sales.gpsCharge)}}</span>
                                <span style="color: red;position:absolute;left:105px;top: 4px;">元</span>
                            </td>
                            <td style="width: 15%;" class="td-title">保险费</td>
                            <td class="td-value" style="width: 35%;">
                                <input v-if="pageType!='look'" type="text"
                                       @blur="strFormat($event.target,'contract.sales.insurancePremium')"
                                       @focus="strFormatF($event.target,'contract.sales.insurancePremium')"
                                       v-onedate="fmoney(contract.sales.insurancePremium)"/>
                                <span v-else>{{fmoney(contract.sales.insurancePremium)}}</span>
                                <span style="color: red;position:absolute;left:105px;top: 4px;">元</span>
                            </td>
                        </tr>
                        <tr v-if="pageType!='look'||(pageType=='look'&&contract.sales.priceOffer&&contract.sales.priceOffer!='无')">
                            <td class="td-title" style="width: 15%;">价格优惠说明</td>
                            <td colspan="3" class="td-value">
                                <input type="text" v-if="pageType!='look'"
                                       v-model="contract.sales.priceOffer" placeholder="单价已享受X万抵X万的展会优惠政策、其他优惠等"/>
                                <span v-else>{{contract.sales.priceOffer}}</span>
                            </td>
                        </tr>
                        <tr v-if="pageType!='look'||(pageType=='look'&&contract.sales.exhibitionGift&&contract.sales.exhibitionGift!='无')">
                            <td class="td-title" style="width: 15%;">展会配件赠送</td>
                            <td colspan="3" class="td-value">
                                <input type="text" v-if="pageType!='look'"
                                       @blur="strFormat($event.target,'contract.sales.exhibitionGift')"
                                       @focus="strFormatF($event.target,'contract.sales.exhibitionGift')"
                                       v-onedate="fmoney(contract.sales.exhibitionGift)"/>
                                <span v-else>{{contract.sales.exhibitionGift}}</span>
                                <span v-if="pageType!='look'" style="color: red;position:absolute;left:105px;top: 4px;">元（{{number2chinese(contract.sales.exhibitionGift)}}）常规保养件</span>
                            </td>
                        </tr>
                        <tr v-if="pageType!='look'||(pageType=='look'&&contract.sales.accessoryGift&&contract.sales.accessoryGift!='无')">
                            <td class="td-title" style="width: 15%;line-height: 1.6;">其他配件赠送<br>（按金额）</td>
                            <td class="td-value" colspan="3">
                                <template v-if="pageType!='look'">
                                    <input type="text" @blur="strFormat($event.target,'contract.sales.accessoryGift')"
                                           @focus="strFormatF($event.target,'contract.sales.accessoryGift')"
                                           v-onedate="fmoney(contract.sales.accessoryGift)"/>
                                </template>
                                <span v-else>{{contract.sales.accessoryGift}}</span>
                                <span v-if="pageType!='look'"
                                      style="color: red;position:absolute;left:105px;top: 4px;    line-height: 2.5">元（{{number2chinese(contract.sales.accessoryGift)}}）常规保养件</span>
                            </td>
                        </tr>
                        <tr v-if="pageType!='look'||(pageType=='look'&&contract.sales.accessoryGiftHour&&contract.sales.accessoryGiftHour!='无')">
                            <td class="td-title" style="width: 15%;line-height: 1.6;">其他配件赠送<br>（小时数）</td>
                            <td colspan="3" class="td-value" style="line-height: 1.6">
                                <input type="text" v-if="pageType!='look'"
                                       @blur="strFormat($event.target,'contract.sales.accessoryGiftHour')"
                                       @focus="strFormatF($event.target,'contract.sales.accessoryGiftHour')"
                                       v-onedate="fmoney(contract.sales.accessoryGiftHour)"
                                       placeholder="填写数字" style="width: 103px"/>
                                <input v-if="pageType!='look'" type="text" v-model="accessoryGiftHourOther"
                                       placeholder="补充说明" style="width: 50%;position: absolute;left: 193px;"/>
                                <span v-else>{{contract.sales.accessoryGiftHour}}</span>
                                <span v-if="pageType!='look'"
                                      style="color: red;position:absolute;left:105px;top: 4px;line-height: 2.7;">小时内保养件</span>
                            </td>
                        </tr>
                        <tr v-if="pageType!='look'||(pageType=='look'&&contract.sales.otherGifts&&contract.sales.otherGifts!='无')">
                            <td class="td-title" style="width: 15%;line-height: 1.6;">其他赠送</td>
                            <td colspan="3" class="td-value">
                                <input type="text" v-if="pageType!='look'" placeholder="如赠送原厂/副厂破碎锤管路、铲斗、礼品、保险等"
                                       v-model="contract.sales.otherGifts"/>
                                <span v-else>{{contract.sales.otherGifts}}</span>
                            </td>
                        </tr>
                    </table>
                    <div class="conIndent">1、买方采用分期方式购买。</div>
                    <div class="conIndent">2、买方在设备到达指定地点前需支付卖方的应付首付款
                        <input style="border:none;border-bottom: 1px solid red;color: red;width: 85px;line-height: 1;text-align: center;"
                               v-if="pageType!='look'" type="text"
                               @blur="strFormat($event.target,'contract.main.fqFirstMoney')"
                               @focus="strFormatF($event.target,'contract.main.fqFirstMoney')"
                               v-onedate="fmoney(contract.main.fqFirstMoney)"/>
                        <span v-else
                              style="display:inline-block;text-indent:0;border-top: none; border-right: none; border-bottom: 1px solid red; border-left: none; border-image: initial; color: red; width: 85px; line-height: 1; text-align: center;">{{fmoney(contract.main.fqFirstMoney)}}</span>
                        <span style="color: red"> 元({{number2chinese(contract.main.fqFirstMoney)}})</span>。
                        <label v-if="pageType!='look'"><input type="checkbox" style="margin-top: 8px !important;"
                                                              value="首付款分期"
                                                              :checked="contract.main.haveFQFirst==1"
                                                              @click="checkedFirstMoneyFQ('FQFirstMoney')"/><span
                                style="margin-left: -24px;">首付款分期</span></label>
                    </div>
                    <template v-if="contract.main.haveFQFirst==0">
                        <div class="conIndent">3、因买方资金不足，卖方允许买方在
                            <input style="border:none;border-bottom: 1px solid red;color: red;width: 48px;line-height: 1;text-align: center;"
                                   v-if="pageType!='look'" type="text" v-model="contract.sales.stageTerm">
                            <span style="color: red" v-else>{{contract.sales.stageTerm}}</span>
                            个月内分
                            <input style="border:none;border-bottom: 1px solid red;color: red;width: 48px;line-height: 1;text-align: center;"
                                   v-if="pageType!='look'" type="text" v-model="contract.sales.payTimes"
                                   @blur="changePayTimes('repayFQMent')">
                            <span style="color: red" v-else>{{contract.sales.payTimes}}</span>
                            次支付结清，具体还款信息如下表：
                            <div style="float:right;position: relative;" v-if="pageType!='look'">
                                <!--<span style="font-size:14px; cursor: pointer;position: absolute;color: #fff;background: rgb(71, 150, 229);padding:0 4px;width: 66px;border-radius: 5px;right: 85px;top:5px;line-height: 1.5;font-weight: bold;text-align: center;text-indent: 0px;"-->
                                <!--@click="addRow('repayFQMent','repayMent')">增加一行</span>-->
                                <a class="a-btn"
                                   @click="addRow('repayFQMent','repayMent')">增加一行
                                </a>
                                <a class="a-btn"
                                   @click="delRow('repayFQMent')">删除一行
                                </a>
                                <!--<span style="font-size:14px; cursor: pointer;position: absolute;color: #fff;background: red;padding:0 4px;width: 66px;border-radius: 5px;right: 0px;top:5px;line-height: 1.5;font-weight: bold;text-align: center;text-indent: 0px;"-->
                                <!--@click="delRow('repayFQMent',i)">删除一行</span>-->
                            </div>
                        </div>
                        <table class="conTable table-detail" cellspacing="0" cellpadding="0">
                            <tr>
                                <td class="td-title" style="width: 25%;">还款日期</td>
                                <td class="td-title" style="width: 25%;">本金(元)</td>
                                <td class="td-title" style="width: 25%;">利息(元)</td>
                                <td class="td-title" style="width: 25%;">本息合计(元)</td>
                            </tr>

                            <tr v-for="(item,i) in main.repayFQMent">
                                <td class="td-value"
                                    style="text-align: center !important;color:#333 !important;font-weight:normal;">
                                    <input
                                            type="text"
                                            v-if="pageType!='look'"
                                            v-model="item.repaymentDate"
                                            placeholder="选择日期"
                                            @focus="showDatePicker($event,main.repayFQMent,i,1)"
                                            style="text-align: center"/>
                                    <span v-else>{{item.repaymentDate}}</span></td>

                                <td class="td-value"
                                    style="text-align: center !important;color:#333 !important;font-weight:normal;">
                                    <input v-if="pageType!='look'" type="text"
                                           @blur="strFormat($event.target,'main.repayFQMent.'+i+'.principal')"
                                           @focus="strFormatF($event.target,'main.repayFQMent.'+i+'.principal')"
                                           v-onedate="fmoney(item.principal)" style="text-align: center"/>
                                    <span v-else
                                          style="text-align: center !important;">{{fmoney(item.principal)}}</span>
                                    <!--<span style="color: red;position:absolute;left:105px;top: 4px;">元</span>-->
                                </td>
                                <td class="td-value"
                                    style="text-align: center !important;color:#333 !important;font-weight:normal;">
                                    <input v-if="pageType!='look'" type="text"
                                           @blur="strFormat($event.target,'main.repayFQMent.'+i+'.interest')"
                                           @focus="strFormatF($event.target,'main.repayFQMent.'+i+'.interest')"
                                           v-onedate="fmoney(item.interest)" style="text-align: center"/>
                                    <span v-else style="text-align: center !important;">{{fmoney(item.interest)}}</span>
                                    <!--<span style="color: red;position:absolute;left:105px;top: 4px;">元</span>-->
                                </td>
                                <td class="td-value"
                                    style="text-align: center !important;color:#333 !important;font-weight:normal;">
                                    <span style="text-align: center !important;">{{fmoney(Number(item.principal)+Number(item.interest))}}</span>
                                    <!--<span style="color: red;position:absolute;left:105px;top: 4px;">元</span>-->


                                </td>
                            </tr>
                            <tr>
                                <td style="font-weight: bold">合计</td>
                                <td class="td-value"
                                    style="text-align:center !important;color:#333 !important;font-weight:normal;">
                                    {{fmoney(total('principal',main.repayFQMent))}}
                                </td>
                                <td class="td-value"
                                    style="text-align: center !important;color:#333 !important;font-weight:normal;">
                                    {{fmoney(total('interest',main.repayFQMent))}}
                                </td>
                                <td class="td-value"
                                    style="text-align: center !important;color:#333 !important;font-weight:normal;">
                                    {{fmoney(total('total',main.repayFQMent))}}
                                </td>
                            </tr>
                            <tr>
                                <td colspan="4" style="text-align: left;padding:0 6px !important;">
                                    备注：1.以上利息为买方分期购买设备应支付给卖方的设备款项利息。</br>
                                    <span style="padding-left: 42px;">2.如果买方还款发生逾期时，需按到期本息合计金额的月利率1%(不足整月按日利率0.07%)支付逾期利息。</span>
                                </td>
                            </tr>
                        </table>

                    </template>

                    <template v-if="contract.main.haveFQFirst==1">
                        <div class="conIndent">3、由于买方资金不足不能一次支付设备首付款总金额，所以卖方允许买方在
                            <input style="border:none;border-bottom: 1px solid red;color: red;width: 48px;line-height: 1;text-align: center;"
                                   v-if="pageType!='look'" type="text" v-model="contract.sales.stageTermFqFirst">
                            <span style="color: red" v-else>{{contract.sales.stageTermFqFirst}}</span>
                            个月内分
                            <input style="border:none;border-bottom: 1px solid red;color: red;width: 48px;line-height: 1;text-align: center;"
                                   v-if="pageType!='look'" type="text" v-model="contract.sales.payTimesFqFirst"
                                   @blur="changePayTimes('repayFQFirst')">
                            <span style="color: red" v-else>{{contract.sales.payTimesFqFirst}}</span>
                            次支付结清，具体首付款支付信息如下表:
                            <div style="float:right;position: relative;" v-if="pageType!='look'">
                                <!--<span style="font-size:14px; cursor: pointer;position: absolute;color: #fff;background: rgb(71, 150, 229);padding:0 4px;width: 66px;border-radius: 5px;right: 85px;top:5px;line-height: 1.5;font-weight: bold;text-align: center;text-indent: 0px;"-->
                                <!--@click="addRow('repayFQMent','repayMent')">增加一行</span>-->
                                <a class="a-btn"
                                   @click="addRow('repayFQFirst','repayFQFirst')">增加一行
                                </a>
                                <a class="a-btn"
                                   @click="delRow('repayFQFirst')">删除一行
                                </a>
                                <!--<span style="font-size:14px; cursor: pointer;position: absolute;color: #fff;background: red;padding:0 4px;width: 66px;border-radius: 5px;right: 0px;top:5px;line-height: 1.5;font-weight: bold;text-align: center;text-indent: 0px;"-->
                                <!--@click="delRow('repayFQMent',i)">删除一行</span>-->
                            </div>
                        </div>

                        <table class="conTable table-detail" cellspacing="0" cellpadding="0">
                            <tr>
                                <td class="td-title" style="width: 25%;">付款日期</td>
                                <td class="td-title" style="width: 25%;">支付金额(元)</td>
                                <td class="td-title" style="width: 50%;" colspan="2">备注</td>
                            </tr>
                            <tr v-for="(item,i) in main.repayFQFirst">
                                <td class="td-value"
                                    style="text-align: center !important;color:#333 !important;font-weight:normal;">
                                    <input type="text"
                                           v-if="pageType!='look'"
                                           v-model="item.repaymentDate"
                                           placeholder="选择日期"
                                           @focus="showDatePicker($event,main.repayFQFirst,i,0)"
                                           style="text-align: center"/>
                                    <span v-else>{{item.repaymentDate}}</span></td>

                                <td class="td-value"
                                    style="text-align: center !important;color:#333 !important;font-weight:normal;">
                                    <input v-if="pageType!='look'" type="text"
                                           @blur="strFormat($event.target,'main.repayFQFirst.'+i+'.principal')"
                                           @focus="strFormatF($event.target,'main.repayFQFirst.'+i+'.principal')"
                                           v-onedate="fmoney(item.principal)" style="text-align: center"
                                    />
                                    <span v-else
                                          style="text-align: center !important;">{{fmoney(item.principal)}}</span>
                                    <!--<span style="color: red;position:absolute;left:105px;top: 4px;">元</span>-->
                                </td>
                                <td class="td-value"
                                    style="text-align: center !important;color:#333 !important;font-weight:normal;"
                                    colspan="2">
                                    <input v-if="pageType!='look'" type="text"
                                           style="text-align: center" v-model="item.remark"/>
                                    <span v-else style="text-align: center !important;">{{item.remark}}</span>
                                    <!--<span style="color: red;position:absolute;left:105px;top: 4px;">元</span>-->
                                </td>
                            </tr>
                            <tr>
                                <td style="font-weight: bold">合计</td>
                                <td class="td-value"
                                    style="text-align: center !important;color:#333 !important;font-weight:normal;">
                                    {{fmoney(total('principal',main.repayFQFirst))}}
                                </td>
                                <td colspan="2">
                                    <div style="width: 400px;height: 1px;background: #aaa;margin: 0 auto;"></div>
                                </td>
                            </tr>
                            <!--<tr>
                                <td colspan="4" style="text-align: left;padding:0 6px !important;">
                                    备注：1.以上利息为买方分期购买设备应支付给卖方的设备款项利息。</br>
                                    <span style="padding-left: 42px;">2.如果买方还款发生逾期时，需按到期本息合计金额的月利率2%(不足整月按日利率0.07%)支付逾期利息。</span>
                                </td>
                            </tr>-->
                        </table>

                        <div class="conIndent">4、因买方资金不足，卖方允许买方在
                            <input style="border:none;border-bottom: 1px solid red;color: red;width: 48px;line-height: 1;text-align: center;"
                                   v-if="pageType!='look'" type="text" v-model="contract.sales.stageTerm">
                            <span style="color: red" v-else>{{contract.sales.stageTerm}}</span>
                            个月内分
                            <input style="border:none;border-bottom: 1px solid red;color: red;width: 48px;line-height: 1;text-align: center;"
                                   v-if="pageType!='look'" type="text" v-model="contract.sales.payTimes"
                                   @blur="changePayTimes('repayFQMent')">
                            <span style="color: red" v-else>{{contract.sales.payTimes}}</span>
                            次支付结清，具体还款信息如下表：
                            <div style="float:right;position: relative;" v-if="pageType!='look'">
                                <!--<span style="font-size:14px; cursor: pointer;position: absolute;color: #fff;background: rgb(71, 150, 229);padding:0 4px;width: 66px;border-radius: 5px;right: 85px;top:5px;line-height: 1.5;font-weight: bold;text-align: center;text-indent: 0px;"-->
                                <!--@click="addRow('repayFQMent','repayFQFirst')">增加一行</span>-->
                                <a class="a-btn"
                                   @click="addRow('repayFQMent','repayMent')">增加一行
                                </a>
                                <a class="a-btn"
                                   @click="delRow('repayFQMent')">删除一行
                                </a>
                                <!--<span style="font-size:14px; cursor: pointer;position: absolute;color: #fff;background: red;padding:0 4px;width: 66px;border-radius: 5px;right: 0px;top:5px;line-height: 1.5;font-weight: bold;text-align: center;text-indent: 0px;"-->
                                <!--@click="delRow('repayFQMent',i)">删除一行</span>-->
                            </div>
                        </div>

                        <table class="conTable table-detail" cellspacing="0" cellpadding="0">
                            <tr>
                                <td class="td-title" style="width: 25%;">还款日期</td>
                                <td class="td-title" style="width: 25%;">本金(元)</td>
                                <td class="td-title" style="width: 25%;">利息(元)</td>
                                <td class="td-title" style="width: 25%;">本息合计(元)</td>
                            </tr>

                            <tr v-for="(item,i) in main.repayFQMent">
                                <td class="td-value"
                                    style="text-align: center !important;color:#333 !important;font-weight:normal;">
                                    <input
                                            type="text"
                                            v-if="pageType!='look'"
                                            v-model="item.repaymentDate"
                                            placeholder="选择日期"
                                            @focus="showDatePicker($event,main.repayFQMent,i,1)"
                                            style="text-align: center"/>
                                    <span v-else>{{item.repaymentDate}}</span></td>

                                <td class="td-value"
                                    style="text-align: center !important;color:#333 !important;font-weight:normal;">
                                    <input v-if="pageType!='look'" type="text"
                                           @blur="strFormat($event.target,'main.repayFQMent.'+i+'.principal')"
                                           @focus="strFormatF($event.target,'main.repayFQMent.'+i+'.principal')"
                                           v-onedate="fmoney(item.principal)" style="text-align: center"/>
                                    <span v-else
                                          style="text-align: center !important;">{{fmoney(item.principal)}}</span>
                                    <!--<span style="color: red;position:absolute;left:105px;top: 4px;">元</span>-->
                                </td>
                                <td class="td-value"
                                    style="text-align: center !important;color:#333 !important;font-weight:normal;">
                                    <input v-if="pageType!='look'" type="text"
                                           @blur="strFormat($event.target,'main.repayFQMent.'+i+'.interest')"
                                           @focus="strFormatF($event.target,'main.repayFQMent.'+i+'.interest')"
                                           v-onedate="fmoney(item.interest)" style="text-align: center"/>
                                    <span v-else style="text-align: center !important;">{{fmoney(item.interest)}}</span>
                                    <!--<span style="color: red;position:absolute;left:105px;top: 4px;">元</span>-->
                                </td>
                                <td class="td-value"
                                    style="text-align: center !important;color:#333 !important;font-weight:normal;">
                                    <span style="text-align: center !important;">{{fmoney(Number(item.principal)+Number(item.interest))}}</span>
                                    <!--<span style="color: red;position:absolute;left:105px;top: 4px;">元</span>-->


                                </td>
                            </tr>
                            <tr>
                                <td style="font-weight: bold">合计</td>
                                <td class="td-value"
                                    style="text-align:center !important;color:#333 !important;font-weight:normal;">
                                    {{fmoney(total('principal',main.repayFQMent))}}
                                </td>
                                <td class="td-value"
                                    style="text-align: center !important;color:#333 !important;font-weight:normal;">
                                    {{fmoney(total('interest',main.repayFQMent))}}
                                </td>
                                <td class="td-value"
                                    style="text-align: center !important;color:#333 !important;font-weight:normal;">
                                    {{fmoney(total('total',main.repayFQMent))}}
                                </td>
                            </tr>
                            <tr>
                                <td colspan="4" style="text-align: left;padding:0 6px !important;">
                                    备注：1.以上利息为买方分期购买设备应支付给卖方的设备款项利息。</br>
                                    <span style="padding-left: 42px;">2.如果买方还款发生逾期时，需按到期本息合计金额的月利率1%(不足整月按日利率0.07%)支付逾期利息。</span>
                                </td>
                            </tr>
                        </table>

                    </template>
                </template>
                <!--设备及付款信息--融资租赁-->
                <template v-if="buyType=='融资租赁'">
                    <div class="bigTitle">二、产品及商务条件：</div>
                    <table class="conTable table-detail" cellspacing="0" cellpadding="0">
                        <tr>
                            <td class="td-title" style="width: 15%;">品牌</td>
                            <td class="td-value" style="width: 35%;">
                                <select v-model="contract.main.brandId" v-if="pageType!='look'" @change="changeBrand">
                                    <option value=""></option>
                                    <option v-for="(item,i) in brandList" v-bind:value="item.id">
                                        {{item.brandName}}
                                    </option>
                                </select>
                                <span v-else>{{contract.main.brandName}}</span>
                            </td>
                            <td style="width: 15%;" class="td-title">制造商</td>
                            <td class="td-value" style="width: 35%;">
                                <select v-if="pageType!='look'" v-model="contract.main.manufacturer">
                                    <option value=""></option>
                                    <option v-for="(item,i) in brandOtherList" v-bind:value="item.manufacturingCompany">
                                        {{item.manufacturingCompany}}
                                    </option>
                                </select>
                                <span v-else>{{contract.main.manufacturer}}</span>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 15%;" class="td-title">型号</td>
                            <td class="td-value" style="width: 35%;">
                                <select v-if="pageType!='look'" v-model="modelMessage" @change="changeModel">
                                    <option value=""></option>
                                    <option v-for="(item,i) in modelList" v-bind:value="item">
                                        {{item.modelName}}
                                    </option>
                                </select>
                                <span v-else>{{contract.main.modelName}}</span>
                            </td>
                            <td style="width:15%;" class="td-title">设备类型</td>
                            <td class="td-value" style="width: 35%;">
                                {{contract.main.deviceType}}
                            </td>

                        </tr>
                        <tr>
                            <td style="width: 15%;" class="td-title">序列号</td>
                            <td class="td-value" style="width: 35%;">
                                {{contract.main.serialNo?contract.main.serialNo:"销售出库后自动带出"}}
                            </td>
                            <td class="td-title">数量</td>
                            <td class="td-value">
                                <span>{{contract.sales.dealNo}}</span>
                            </td>
                        </tr>
                        <tr>
                            <td class="td-title">单价</td>
                            <td class="td-value">
                                <input v-if="pageType!='look'" type="text"
                                       @blur="strFormat($event.target,'contract.sales.unitPrice')"
                                       @focus="strFormatF($event.target,'contract.sales.unitPrice')"
                                       v-onedate="fmoney(contract.sales.unitPrice)"/>
                                <span v-else>{{fmoney(contract.sales.unitPrice)}}</span>
                                <span style="color: red;position:absolute;left:105px;top: 4px;">元</span>
                            </td>
                            <td class="td-title">不含税金额</td>
                            <td class="td-value">
                                <span>{{fmoney((contract.sales.unitPrice/1.13))}}</span>
                                <span style="color: red;position:absolute;left:105px;top: 4px;">元</span>
                            </td>
                        </tr>
                        <tr>
                            <td class="td-title">增值税税额（13%）</td>
                            <td class="td-value">
                                <span>{{fmoney((contract.sales.unitPrice-(contract.sales.unitPrice/1.13)))}}</span>
                                <span style="color: red;position:absolute;left:105px;top: 4px;">元</span>
                            </td>
                            <td class="td-title">总价</td>
                            <td class="td-value">
                                <span>{{getSalesTotalPrice}}</span>
                                <span style="color: red;position:absolute;left:105px;top: 4px;">元</span>
                            </td>
                        </tr>
                        <tr>
                            <td class="td-title" style="width: 15%;">融资公司</td>
                            <!-- <td class="td-value" style="width: 85%;" colspan="3">
                                 <span>{{contract.main.financeCompany}}</span>
                             </td>-->
                            <td class="td-value" style="width: 85%;" colspan="3">
                                <select v-if="pageType!='look'" v-model="contract.main.financeCompany">
                                    <option value=""></option>
                                    <option v-for="(item,i) in brandOtherList" v-bind:value="item.financeCompany">
                                        {{item.financeCompany}}
                                    </option>
                                </select>
                                <span v-else>{{contract.main.financeCompany}}</span>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 15%;" class="td-title">首付比例</td>
                            <td class="td-value" style="width: 35%;">
                                <input type="text" v-if="pageType!='look'"
                                       v-model="contract.sales.downPayment"/>
                                <span v-else>{{contract.sales.downPayment}}</span>
                                <span style="color: red;position:absolute;left:108px;top: 4px;">%</span>
                            </td>
                            <td class="td-title">设备首付金额</td>
                            <td class="td-value">
                                <input v-if="pageType!='look'" type="text"
                                       @blur="strFormat($event.target,'contract.sales.firstPayment')"
                                       @focus="strFormatF($event.target,'contract.sales.firstPayment')"
                                       v-onedate="fmoney(contract.sales.firstPayment)" id="salesFirstPayment"
                                       v-on:input="getRZZL($event.target.value,'firstPayment')"/>
                                <span v-else>{{fmoney(contract.sales.firstPayment)}}</span>
                                <span style="color: red;position:absolute;left:105px;top: 4px;">元</span>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 15%;" class="td-title">融资比例</td>
                            <td class="td-value" style="width: 35%;">
                                <input type="text" v-if="pageType!='look'"
                                       v-model="contract.sales.loanRation"/>
                                <span v-else>{{contract.sales.loanRation}}</span>
                                <span style="color: red;position:absolute;left:108px;top: 4px;">%</span>
                            </td>
                            <td class="td-title">融资金额</td>
                            <td class="td-value">
                                <input v-if="pageType!='look'" type="text"
                                       @blur="strFormat($event.target,'contract.sales.loanAmount')"
                                       @focus="strFormatF($event.target,'contract.sales.loanAmount')"
                                       v-onedate="fmoney(contract.sales.loanAmount)" id="salesLoanAmount"/>
                                <span v-else>{{fmoney(contract.sales.loanAmount)}}</span>
                                <span style="color: red;position:absolute;left:105px;top: 4px;">元</span>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 15%;" class="td-title">贷款期限</td>
                            <td class="td-value" style="width: 35%;">
                                <input type="text" v-if="pageType!='look'"
                                       v-model="contract.sales.loanTerm"/>
                                <span v-else>{{contract.sales.loanTerm}}</span>
                                <span style="color: red;position:absolute;left:90px;top: 4px;">个月</span>
                            </td>
                            <td class="td-title">保证金</td>
                            <td class="td-value">
                                <input v-if="pageType!='look'" type="text"
                                       @blur="strFormat($event.target,'contract.sales.bond')"
                                       @focus="strFormatF($event.target,'contract.sales.bond')"
                                       v-onedate="fmoney(contract.sales.bond)"/>
                                <span v-else>{{fmoney(contract.sales.bond)}}</span>
                                <span style="color: red;position:absolute;left:105px;top: 4px;">元</span>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 15%;" class="td-title">保险费</td>
                            <td class="td-value" style="width: 35%;">
                                <input v-if="pageType!='look'" type="text"
                                       @blur="strFormat($event.target,'contract.sales.insurancePremium')"
                                       @focus="strFormatF($event.target,'contract.sales.insurancePremium')"
                                       v-onedate="fmoney(contract.sales.insurancePremium)"/>
                                <span v-else>{{fmoney(contract.sales.insurancePremium)}}</span>
                                <span style="color: red;position:absolute;left:105px;top: 4px;">元</span>
                            </td>
                            <td class="td-title">手续费</td>
                            <td class="td-value">
                                <input v-if="pageType!='look'" type="text"
                                       @blur="strFormat($event.target,'contract.sales.serviceCharge')"
                                       @focus="strFormatF($event.target,'contract.sales.serviceCharge')"
                                       v-onedate="fmoney(contract.sales.serviceCharge)"/>
                                <span v-else>{{fmoney(contract.sales.serviceCharge)}}</span>
                                <span style="color: red;position:absolute;left:105px;top: 4px;">元</span>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 15%;" class="td-title">GPS费</td>

                            <td class="td-value" style="width: 35%;">
                                <input v-if="pageType!='look'" type="text"
                                       @blur="strFormat($event.target,'contract.sales.gpsCharge')"
                                       @focus="strFormatF($event.target,'contract.sales.gpsCharge')"
                                       v-onedate="fmoney(contract.sales.gpsCharge)"/>
                                <span v-else>{{fmoney(contract.sales.gpsCharge)}}</span>
                                <span style="color: red;position:absolute;left:105px;top: 4px;">元</span>
                            </td>
                            <td class="td-title">担保费</td>
                            <td class="td-value">
                                <input v-if="pageType!='look'" type="text"
                                       @blur="strFormat($event.target,'contract.sales.securityCharge')"
                                       @focus="strFormatF($event.target,'contract.sales.securityCharge')"
                                       v-onedate="fmoney(contract.sales.securityCharge)"/>
                                <span v-else>{{fmoney(contract.sales.securityCharge)}}</span>
                                <span style="color: red;position:absolute;left:105px;top: 4px;">元</span>
                            </td>
                        </tr>
                        <tr>
                            <td class="td-title" style="width: 15%;">首付款合计</td>
                            <td class="td-value" style="width: 85%;" colspan="3">
                                <span v-if="pageType!='look'">{{fmoney( Number(contract.sales.firstPayment) + Number(contract.sales.bond) + Number(contract.sales.insurancePremium) + Number(contract.sales.serviceCharge) + Number(contract.sales.gpsCharge) + Number(contract.sales.securityCharge))}}</span>
                                <span v-else>{{fmoney(contract.sales.firstTotalPayment)}}</span>
                                <span style="color: red;position:absolute;left:105px;top: 4px;">元</span>
                            </td>
                        </tr>
                        <tr>
                            <td class="td-title" style="width: 15%;">合计</td>
                            <td class="td-value" style="width: 85%;" colspan="3">
                                <!--                                <input v-if="pageType!='look'" type="text"-->
                                <!--                                       @blur="strFormat($event.target,'contract.sales.total')"-->
                                <!--                                       @focus="strFormatF($event.target,'contract.sales.total')"-->
                                <!--                                       v-onedate="fmoney(contract.sales.total)"/>-->
                                <span v-if="pageType!='look'">{{fmoney( Number(contract.sales.firstPayment) + Number(contract.sales.bond) + Number(contract.sales.insurancePremium) + Number(contract.sales.serviceCharge) + Number(contract.sales.gpsCharge) + Number(contract.sales.securityCharge)+Number(contract.sales.loanAmount))}}</span>
                                <span v-else>{{fmoney(contract.sales.total)}}</span>
                                <!-- <span>{{getSalesTotal}}</span>-->
                                <span style="color: red;position:absolute;left:105px;top: 4px;">元</span>
                                <!--<span style="color: #bbb;position:absolute;left:125px;top: 4px;">(总价+保险费+手续费+GPS费+担保费+其他费用)</span>-->
                            </td>
                        </tr>
                        <tr v-if="pageType!='look'||(pageType=='look'&&contract.sales.priceOffer&&contract.sales.priceOffer!='无')">
                            <td class="td-title" style="width: 15%;">价格优惠说明</td>
                            <td colspan="3" class="td-value">
                                <input type="text" v-if="pageType!='look'"
                                       v-model="contract.sales.priceOffer" placeholder="单价已享受X万抵X万的展会优惠政策、其他优惠等"/>
                                <span v-else>{{contract.sales.priceOffer}}</span>
                            </td>
                        </tr>
                        <tr v-if="pageType!='look'||(pageType=='look'&&contract.sales.exhibitionGift&&contract.sales.exhibitionGift!='无')">
                            <td class="td-title" style="width: 15%;">展会配件赠送</td>
                            <td colspan="3" class="td-value">
                                <input type="text" v-if="pageType!='look'"
                                       @blur="strFormat($event.target,'contract.sales.exhibitionGift')"
                                       @focus="strFormatF($event.target,'contract.sales.exhibitionGift')"
                                       v-onedate="fmoney(contract.sales.exhibitionGift)"/>
                                <span v-else>{{contract.sales.exhibitionGift}}</span>
                                <span v-if="pageType!='look'" style="color: red;position:absolute;left:105px;top: 4px;">元（{{number2chinese(contract.sales.exhibitionGift)}}）常规保养件</span>
                            </td>
                        </tr>
                        <tr v-if="pageType!='look'||(pageType=='look'&&contract.sales.accessoryGift&&contract.sales.accessoryGift!='无')">
                            <td class="td-title" style="width: 15%;line-height: 1.6;">其他配件赠送<br>（按金额）</td>
                            <td class="td-value" colspan="3">
                                <template v-if="pageType!='look'">
                                    <input type="text" @blur="strFormat($event.target,'contract.sales.accessoryGift')"
                                           @focus="strFormatF($event.target,'contract.sales.accessoryGift')"
                                           v-onedate="fmoney(contract.sales.accessoryGift)"/>
                                </template>
                                <span v-else>{{contract.sales.accessoryGift}}</span>
                                <span v-if="pageType!='look'"
                                      style="color: red;position:absolute;left:105px;top: 4px;line-height: 2.5;">元（{{number2chinese(contract.sales.accessoryGift)}}）常规保养件</span>
                            </td>
                        </tr>
                        <tr v-if="pageType!='look'||(pageType=='look'&&contract.sales.accessoryGiftHour&&contract.sales.accessoryGiftHour!='无')">
                            <td class="td-title" style="width: 15%;line-height: 1.6;">其他配件赠送<br>（小时数）</td>
                            <td colspan="3" class="td-value" style="line-height: 1.6">
                                <input type="text" v-if="pageType!='look'"
                                       @blur="strFormat($event.target,'contract.sales.accessoryGiftHour')"
                                       @focus="strFormatF($event.target,'contract.sales.accessoryGiftHour')"
                                       v-onedate="fmoney(contract.sales.accessoryGiftHour)"
                                       placeholder="填写数字" style="width: 103px"/>
                                <input v-if="pageType!='look'" type="text" v-model="accessoryGiftHourOther"
                                       placeholder="补充说明" style="width: 50%;position: absolute;left: 193px;"/>
                                <span v-else>{{contract.sales.accessoryGiftHour}}</span>
                                <span v-if="pageType!='look'"
                                      style="color: red;position:absolute;left:105px;top: 4px;line-height: 2.7;">小时内保养件</span>
                            </td>
                        </tr>
                        <tr v-if="pageType!='look'||(pageType=='look'&&contract.sales.otherGifts&&contract.sales.otherGifts!='无')">
                            <td class="td-title" style="width: 15%;line-height: 1.6;">其他赠送</td>
                            <td colspan="3" class="td-value">
                                <input type="text" v-if="pageType!='look'" placeholder="如赠送原厂/副厂破碎锤管路、铲斗、礼品、保险等"
                                       v-model="contract.sales.otherGifts"/>
                                <span v-else>{{contract.sales.otherGifts}}</span>
                            </td>
                        </tr>
                    </table>
                </template>
                <!--设备及付款信息--融资租赁打包-->
                <template v-if="buyType=='融资租赁打包'">
                    <div class="bigTitle">二、产品及商务条件：</div>
                    <table class="conTable table-detail" cellspacing="0" cellpadding="0">
                        <tr>
                            <td class="td-title" style="width: 15%;">品牌</td>
                            <td class="td-value" style="width: 35%;">
                                <select v-model="contract.main.brandId" v-if="pageType!='look'" @change="changeBrand">
                                    <option value=""></option>
                                    <option v-for="(item,i) in brandList" v-bind:value="item.id">
                                        {{item.brandName}}
                                    </option>
                                </select>
                                <span v-else>{{contract.main.brandName}}</span>
                            </td>
                            <td style="width: 15%;" class="td-title">制造商</td>
                            <td class="td-value" style="width: 35%;">
                                <select v-if="pageType!='look'" v-model="contract.main.manufacturer">
                                    <option value=""></option>
                                    <option v-for="(item,i) in brandOtherList" v-bind:value="item.manufacturingCompany">
                                        {{item.manufacturingCompany}}
                                    </option>
                                </select>
                                <span v-else>{{contract.main.manufacturer}}</span>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 15%;" class="td-title">型号</td>
                            <td class="td-value" style="width: 35%;">
                                <select v-if="pageType!='look'" v-model="modelMessage" @change="changeModel">
                                    <option value=""></option>
                                    <option v-for="(item,i) in modelList" v-bind:value="item">
                                        {{item.modelName}}
                                    </option>
                                </select>
                                <span v-else>{{contract.main.modelName}}</span>
                            </td>
                            <td style="width:15%;" class="td-title">设备类型</td>
                            <td class="td-value" style="width: 35%;">
                                {{contract.main.deviceType}}
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 15%;" class="td-title">序列号</td>
                            <td class="td-value" style="width: 35%;">
                                {{contract.main.serialNo?contract.main.serialNo:"销售出库后自动带出"}}
                            </td>
                            <td class="td-title">数量</td>
                            <td class="td-value">
                                <span>{{contract.sales.dealNo}}</span>
                            </td>
                        </tr>
                        <tr>
                            <td class="td-title">车价价税合计</td>
                            <td class="td-value">
                                <input v-if="pageType!='look'" type="text"
                                       @blur="strFormat($event.target,'contract.sales.unitPrice')"
                                       @focus="strFormatF($event.target,'contract.sales.unitPrice')"
                                       v-onedate="fmoney(contract.sales.unitPrice)"/>
                                <span v-else>{{fmoney(contract.sales.unitPrice)}}</span>
                                <span style="color: red;position:absolute;left:105px;top: 4px;">元</span>
                            </td>
                            <td class="td-title">总价</td>
                            <td class="td-value">
                                <span>{{getSalesTotalPrice}}</span>
                                <span style="color: red;position:absolute;left:105px;top: 4px;">元</span>
                            </td>
                            <!--<td class="td-title">不含税金额</td>-->
                            <!--<td class="td-value">-->
                            <!--<span>{{fmoney((contract.sales.unitPrice/1.13))}}</span>-->
                            <!--<span style="color: red;position:absolute;left:105px;top: 4px;">元</span>-->
                            <!--</td>-->
                        </tr>
                        <tr>
                            <td class="td-title">车价不含税金额</td>
                            <td class="td-value">
                                <span>{{fmoney((contract.sales.unitPrice/1.13))}}</span>
                                <span style="color: red;position:absolute;left:105px;top: 4px;">元</span>
                            </td>
                            <td class="td-title">车价增值税税额（13%）</td>
                            <td class="td-value">
                                <span>{{fmoney((contract.sales.unitPrice-(contract.sales.unitPrice/1.13)))}}</span>
                                <span style="color: red;position:absolute;left:105px;top: 4px;">元</span>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 15%;" class="td-title">手续费</td>
                            <td class="td-value">
                                <input type="text" v-if="pageType!='look'"
                                       @blur="strFormat($event.target,'contract.sales.serviceCharge')"
                                       @focus="strFormatF($event.target,'contract.sales.serviceCharge')"
                                       v-onedate="fmoney(contract.sales.serviceCharge)"/>
                                <span v-else>{{contract.sales.serviceCharge}}</span>
                                <span style="color: red;position:absolute;left:105px;top: 4px;">元</span>
                            </td>


                            <td class="td-title">保险费</td>
                            <td class="td-value">
                                <input type="text" v-if="pageType!='look'"
                                       @blur="strFormat($event.target,'contract.sales.insurancePremium')"
                                       @focus="strFormatF($event.target,'contract.sales.insurancePremium')"
                                       v-onedate="fmoney(contract.sales.insurancePremium)"/>
                                <span v-else>{{contract.sales.insurancePremium}}</span>
                                <span style="color: red;position:absolute;left:105px;top: 4px;">元</span>
                            </td>
                        </tr>
                        <tr>
                            <td class="td-title" style="width: 15%;">融资公司</td>
                            <td class="td-value" style="width: 85%;" colspan="3">
                                <select v-if="pageType!='look'" v-model="contract.main.financeCompany">
                                    <option value=""></option>
                                    <option v-for="(item,i) in brandOtherList" v-bind:value="item.financeCompany">
                                        {{item.financeCompany}}
                                    </option>
                                </select>
                                <span v-else>{{contract.main.financeCompany}}</span>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 15%;" class="td-title">首付比例</td>
                            <td class="td-value" style="width: 35%;">
                                <input type="text" v-if="pageType!='look'"
                                       v-model="contract.sales.downPayment"/>
                                <span v-else>{{contract.sales.downPayment}}</span>
                                <span style="color: red;position:absolute;left:108px;top: 4px;">%</span>
                            </td>
                            <td class="td-title">首付金额</td>
                            <td class="td-value">
                                <input v-if="pageType!='look'" type="text"
                                       @blur="strFormat($event.target,'contract.sales.firstPayment')"
                                       @focus="strFormatF($event.target,'contract.sales.firstPayment')"
                                       v-onedate="fmoney(contract.sales.firstPayment)" id="salesFirstPayment"/>
                                <span v-else>{{fmoney(contract.sales.firstPayment)}}</span>
                                <span style="color: red;position:absolute;left:105px;top: 4px;">元</span>
                            </td>
                        </tr>
                        <tr>
                            <td class="td-title">融资比例</td>
                            <td class="td-value">
                                <input type="text" v-if="pageType!='look'"
                                       v-model="contract.sales.loanRation"/>
                                <span v-else>{{contract.sales.loanRation}}</span>
                                <span style="color: red;position:absolute;left:105px;top: 4px;">%</span>
                            </td>
                            <td class="td-title">融资金额</td>
                            <td class="td-value">
                                <input v-if="pageType!='look'" type="text"
                                       @blur="strFormat($event.target,'contract.sales.loanAmount')"
                                       @focus="strFormatF($event.target,'contract.sales.loanAmount')"
                                       v-onedate="fmoney(contract.sales.loanAmount)"/>
                                <span v-else>{{fmoney(contract.sales.loanAmount)}}</span>
                                <span style="color: red;position:absolute;left:105px;top: 4px;">元</span>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 15%;" class="td-title">融资期限</td>
                            <td class="td-value" style="width: 35%;">
                                <input type="text" v-if="pageType!='look'"
                                       v-model="contract.sales.loanTerm"/>
                                <span v-else>{{contract.sales.loanTerm}}</span>
                                <span style="color: red;position:absolute;left:90px;top: 4px;">个月</span>
                            </td>
                            <td class="td-title">保证金</td>
                            <td class="td-value">
                                <input v-if="pageType!='look'" type="text"
                                       @blur="strFormat($event.target,'contract.sales.bond')"
                                       @focus="strFormatF($event.target,'contract.sales.bond')"
                                       v-onedate="fmoney(contract.sales.bond)"/>
                                <span v-else>{{fmoney(contract.sales.bond)}}</span>
                                <span style="color: red;position:absolute;left:105px;top: 4px;">元</span>
                            </td>
                        </tr>
                        <!--<tr>-->
                        <!--<td class="td-title" v-if="repaymentType=='季度还款'">季度还款</td>-->
                        <!--<td v-else class="td-title">月还款</td>-->
                        <!--<td class="td-value">-->
                        <!--<input v-if="pageType!='look'" type="text"-->
                        <!--@blur="strFormat($event.target,'contract.sales.monthlyRepayment')"-->
                        <!--@focus="strFormatF($event.target,'contract.sales.monthlyRepayment')"-->
                        <!--v-onedate="fmoney(contract.sales.monthlyRepayment)"/>-->
                        <!--<span v-else>{{fmoney(contract.sales.monthlyRepayment)}}</span>-->
                        <!--<span style="color: red;position:absolute;left:105px;top: 4px;">元</span>-->
                        <!--</td>-->
                        <!--<td class="td-title" style="width: 15%;">首付款合计</td>-->
                        <!--<td class="td-value" style="width: 85%;">-->
                        <!--<span v-if="pageType!='look'">{{fmoney( Number(contract.sales.firstPayment) + Number(contract.sales.bond) + Number(contract.sales.insurancePremium) + Number(contract.sales.serviceCharge) + Number(contract.sales.gpsCharge) +Number(contract.sales.securityCharge))}}</span>-->
                        <!--<span v-else>{{fmoney(contract.sales.firstTotalPayment)}}</span>-->
                        <!--<span style="color: red;position:absolute;left:105px;top: 4px;">元</span>-->
                        <!--</td>-->
                        <!--</tr>-->
                        <tr>
                            <td class="td-title" style="width: 15%;">合计</td>
                            <td class="td-value" style="width: 85%;" colspan="3">
                                <input v-if="pageType!='look'" type="text" style="float:left;width: 100px;"
                                       @blur="strFormat($event.target,'contract.sales.total')"
                                       @focus="strFormatF($event.target,'contract.sales.total')"
                                       v-onedate="fmoney(contract.sales.total)"/>
                                <span v-else style="float:left;width: 100px;">{{fmoney(contract.sales.total)}}</span>
                                <!-- <span>{{getSalesTotal}}</span>-->
                                元 ({{number2chinese(contract.sales.total)}})
                                <!--<span style="color: #bbb;position:absolute;left:125px;top: 4px;">(总价+保险费+手续费+GPS费+担保费+其他费用)</span>-->
                            </td>
                        </tr>
                        <tr v-if="pageType!='look'||(pageType=='look'&&contract.sales.priceOffer&&contract.sales.priceOffer!='无')">
                            <td class="td-title" style="width: 15%;">价格优惠说明</td>
                            <td colspan="3" class="td-value">
                                <input type="text" v-if="pageType!='look'"
                                       v-model="contract.sales.priceOffer" placeholder="单价已享受X万抵X万的展会优惠政策、其他优惠等"/>
                                <span v-else>{{contract.sales.priceOffer}}</span>
                            </td>
                        </tr>
                        <tr v-if="pageType!='look'||(pageType=='look'&&contract.sales.exhibitionGift&&contract.sales.exhibitionGift!='无')">
                            <td class="td-title" style="width: 15%;">展会配件赠送</td>
                            <td colspan="3" class="td-value">
                                <input type="text" v-if="pageType!='look'"
                                       @blur="strFormat($event.target,'contract.sales.exhibitionGift')"
                                       @focus="strFormatF($event.target,'contract.sales.exhibitionGift')"
                                       v-onedate="fmoney(contract.sales.exhibitionGift)"/>
                                <span v-else>{{contract.sales.exhibitionGift}}</span>
                                <span v-if="pageType!='look'" style="color: red;position:absolute;left:105px;top: 4px;">元（{{number2chinese(contract.sales.exhibitionGift)}}）常规保养件</span>
                            </td>
                        </tr>
                        <tr v-if="pageType!='look'||(pageType=='look'&&contract.sales.accessoryGift&&contract.sales.accessoryGift!='无')">
                            <td class="td-title" style="width: 15%;line-height: 1.6;">其他配件赠送<br>（按金额）</td>
                            <td class="td-value" colspan="3">
                                <template v-if="pageType!='look'">
                                    <input type="text" @blur="strFormat($event.target,'contract.sales.accessoryGift')"
                                           @focus="strFormatF($event.target,'contract.sales.accessoryGift')"
                                           v-onedate="fmoney(contract.sales.accessoryGift)"/>
                                </template>
                                <span v-else>{{contract.sales.accessoryGift}}</span>
                                <span v-if="pageType!='look'"
                                      style="color: red;position:absolute;left:105px;top: 4px;line-height: 2.5;">元（{{number2chinese(contract.sales.accessoryGift)}}）常规保养件</span>
                            </td>
                        </tr>
                        <tr v-if="pageType!='look'||(pageType=='look'&&contract.sales.accessoryGiftHour&&contract.sales.accessoryGiftHour!='无')">
                            <td class="td-title" style="width: 15%;line-height: 1.6;">其他配件赠送<br>（小时数）</td>
                            <td colspan="3" class="td-value" style="line-height: 1.6">
                                <input type="text" v-if="pageType!='look'"
                                       @blur="strFormat($event.target,'contract.sales.accessoryGiftHour')"
                                       @focus="strFormatF($event.target,'contract.sales.accessoryGiftHour')"
                                       v-onedate="fmoney(contract.sales.accessoryGiftHour)"
                                       placeholder="填写数字" style="width: 103px"/>
                                <input v-if="pageType!='look'" type="text" v-model="accessoryGiftHourOther"
                                       placeholder="补充说明" style="width: 50%;position: absolute;left: 193px;"/>
                                <span v-else>{{contract.sales.accessoryGiftHour}}</span>
                                <span v-if="pageType!='look'"
                                      style="color: red;position:absolute;left:105px;top: 4px;line-height: 2.7;">小时内保养件</span>
                            </td>
                        </tr>
                        <tr v-if="pageType!='look'||(pageType=='look'&&contract.sales.otherGifts&&contract.sales.otherGifts!='无')">
                            <td class="td-title" style="width: 15%;line-height: 1.6;">其他赠送</td>
                            <td colspan="3" class="td-value">
                                <input type="text" v-if="pageType!='look'" placeholder="如赠送原厂/副厂破碎锤管路、铲斗、礼品、保险等"
                                       v-model="contract.sales.otherGifts"/>
                                <span v-else>{{contract.sales.otherGifts}}</span>
                            </td>
                        </tr>
                    </table>
                </template>
                <!--垫款-->
                <template v-if="diankuan=='1'">
                    <div class="bigTitle">三、垫款条款：</div>
                    <div class="conIndent">因买方资金不足，卖方替买方垫付首付款
                        <input style="border:none;border-bottom: 1px solid red;color: red;width: 85px;line-height: 1;text-align: center;"
                               v-if="pageType!='look'" type="text"
                               @blur="strFormat($event.target,'contract.main.dkFirstMoney')"
                               @focus="strFormatF($event.target,'contract.main.dkFirstMoney')"
                               v-onedate="fmoney(contract.main.dkFirstMoney)"/>
                        <span v-else
                              style="display:inline-block;text-indent:0;border-top: none; border-right: none; border-bottom: 1px solid red; border-left: none; border-image: initial; color: red; width: 85px; line-height: 1; text-align: center;">{{fmoney(contract.main.dkFirstMoney)}}</span>
                        <span style="color: red"> 元({{number2chinese(contract.main.dkFirstMoney)}})</span>，垫款的具体还款信息如下表：
                        <div style="float:right;" v-if="pageType!='look'">
                            <a style="" class="a-btn"
                               @click="addRow('repayDKMent','repayMent')">增加一行
                            </a>
                            <a style="" class="a-btn"
                               @click="delRow('repayDKMent')">删除一行
                            </a>
                        </div>
                    </div>
                    <table class="conTable table-detail" cellspacing="0" cellpadding="0">
                        <tr>
                            <td class="td-title" style="width: 25%;">还款日期</td>
                            <td class="td-title" style="width: 25%;">本金(元)</td>
                            <td class="td-title" style="width: 25%;">利息(元)</td>
                            <td class="td-title" style="width: 25%;">本息合计(元)</td>
                        </tr>
                        <tr v-for="(item,i) in main.repayDKMent">
                            <td class="td-value"
                                style="text-align: center !important;color:#333 !important;font-weight:normal;"><input
                                    type="text"
                                    v-if="pageType!='look'"
                                    v-model="item.repaymentDate"
                                    placeholder="选择日期"
                                    @focus="showDatePicker($event,main.repayDKMent,i,0)"
                                    style="text-align: center !important;"/>
                                <span v-else>{{item.repaymentDate}}</span></td>
                            <td class="td-value"
                                style="text-align: center !important;color:#333 !important;font-weight:normal;">
                                <input v-if="pageType!='look'" type="text"
                                       @blur="strFormat($event.target,'main.repayDKMent.'+i+'.principal')"
                                       @focus="strFormatF($event.target,'main.repayDKMent.'+i+'.principal')"
                                       v-onedate="fmoney(item.principal)" style="text-align: center !important;"/>
                                <span v-else>{{fmoney(item.principal)}}</span>

                            </td>
                            <td class="td-value"
                                style="text-align: center !important;color:#333 !important;font-weight:normal;">
                                <input v-if="pageType!='look'" type="text"
                                       @blur="strFormat($event.target,'main.repayDKMent.'+i+'.interest')"
                                       @focus="strFormatF($event.target,'main.repayDKMent.'+i+'.interest')"
                                       v-onedate="fmoney(item.interest)" style="text-align: center !important;"/>
                                <span v-else>{{fmoney(item.interest)}}</span>
                            </td>
                            <td class="td-value"
                                style="text-align: center !important;color:#333 !important;font-weight:normal;">
                                <span>{{fmoney(Number(item.principal)+Number(item.interest))}}</span>
                            </td>
                        </tr>
                        <tr>
                            <td style="font-weight: bold">合计</td>
                            <td class="td-value"
                                style="text-align: center !important;color:#333 !important;font-weight:normal;">
                                {{fmoney(total('principal',main.repayDKMent))}}
                            </td>
                            <td class="td-value"
                                style="text-align: center !important;color:#333 !important;font-weight:normal;">
                                {{fmoney(total('interest',main.repayDKMent))}}
                            </td>
                            <td class="td-value"
                                style="text-align: center !important;color:#333 !important;font-weight:normal;">
                                {{fmoney(total('total',main.repayDKMent))}}
                            </td>
                        </tr>
                        <tr>
                            <td colspan="4" style="text-align: left;padding:0 6px !important;">
                                备注：如果买方逾期时，需按到期本息合计金额的月利率2%(不足整月按日利率0.07%)支付罚息。
                            </td>
                        </tr>
                    </table>
                </template>
                <template v-if="buyType=='融资租赁打包'||buyType=='融资租赁'">
                    <div class="bigTitle"> {{getNumber('条款','2')}}、付款方式：</div>
                    <div class="conIndent">
                        1、买方采用融资租赁方式购买，在卖方设备到达买方指定地点前一次性结清首付款项。
                    </div>
                    <div class="conIndent">
                        2、如果买方发生款项逾期时，需按月利率1%，不足整月按日利率0.03%支付给卖方逾期利息。
                    </div>
                </template>
                <!--担保条款-->
                <template
                        v-if="buyType=='内部分期'&&contractType!='2'">
                    <div class="bigTitle">{{getNumber('条款','2')}}、担保条款：</div>
                    <div class="conIndent">担保方的保证方式为连带责任保证，当买方不按《销售合同》或《融资租赁协议》的约定履行还款义务时，卖方有权直接向担保方追偿，担保方应立即向卖方清偿。
                    </div>
                </template>
                <!--设备所有权-->
                <template>
                    <div class="bigTitle">{{getNumber('条款','3')}}、设备所有权：</div>
                    <div class="conIndent">除非买方已按本合同付清设备的所有款项(包括首付款、代垫款、融资租赁款以及各种税费)，否则设备的所有权始终属于卖方。</div>
                </template>

                <!--质量保证期-->
                <template>
                    <div class="bigTitle">{{getNumber('条款','4')}}、质量保证期：</div>
                    <div class="conIndent">按<span style="color:red;">{{contract.main.manufacturer}}</span>全球统一标准执行，详见随机质保书。
                    </div>
                </template>

                <!--一裤衩条款-->
                <template v-if="buyType=='全款'">
                    <!--其他约定事项-->
                    <div class="bigTitle"> {{getNumber('条款','5')}}、其他约定事项：</div>
                    <div class="conIndent">
                        1、买方不得以商品质量为由拒付任何款项，否则卖方有权停止一切配件供应和服务工作，并不承担任何责任。
                    </div>
                    <div class="conIndent">
                        2、如果买方未按时支付商品款，卖方可随时通过GPS将该设备停机并收回该设备，并要求买方结清全部商品欠款、赔偿其它损失。在收回商品60日内买方还未支付所欠全部商品欠款和各种税费时，卖方有权将设备直接另行出售（买方确认卖方的上述设备处置方式和处置所得价款，不存在任何异议），所得价款优先用于偿付买方所欠全部商品款项、各种税费（含收回商品后产生的税费）、其它损失和由此支出的所有费用（包括但不限于诉讼费、公证费、律师费、差旅费），不足部分，继续向买方追偿。
                    </div>
                    <div class="conIndent">3、商品在无信号地区连续工作61天会自动锁机（51天和58天时会自动发出锁车警告）。</div>
                    <div class="conIndent">
                        4、如买方采用承兑方式支付商品款，则卖方有权按照银行实时利率对买方收取贴现利息。
                    </div>
                    <div class="conIndent">
                        5、如商品保险期间出险，由买方自行向保险公司索赔，卖方仅有协助义务,并不承担任何相关责任。如买方拒绝在卖方处对出险商品进行维修或买方不能在出险一个月内提供完整的理赔所需资料，卖方有权拒绝协助理赔。
                    </div>
                    <div class="conIndent">
                        6、在买方付清所有的商品款后，卖方向买方出具正规发票（发票上的付款人与收款人的名称与本合同买卖双方的名称一致），买方不得以任何理由要求卖方更改发票上的名称，否则卖方有权拒开。
                    </div>
                    <div class="conIndent">
                        7、若设备出现故障、毁损、灭失等风险，由买方自行承担相应的损失，与卖方无关。
                    </div>
                    <div class="conIndent">8、发票开票信息要求：付款方与发票受票方名称需一致。</div>
                    <div class="conIndent">9、本合同应显示卖方名称水印，如无水印，则合同无效。</div>
                </template>

                <!--一裤衩条款-->
                <template v-if="buyType=='内部分期'">
                    <!--其他约定事项-->
                    <div class="bigTitle"> {{getNumber('条款','5')}}、其他约定事项：</div>
                    <div class="conIndent">
                        1、买方不得以商品质量为由拒付任何款项，否则卖方有权停止一切配件供应和服务工作，并不承担任何责任。
                    </div>
                    <div class="conIndent">
                        2、如果买方未按时支付商品款，卖方可随时通过GPS将该设备停机并收回该设备，并要求买方结清全部商品欠款、赔偿其它损失。在收回商品60日内买方还未支付所欠全部商品欠款和各种税费时，卖方有权将设备直接另行出售（买方确认卖方的上述设备处置方式和处置所得价款，不存在任何异议），所得价款优先用于偿付买方所欠全部商品款项、各种税费（含收回商品后产生的税费）、其它损失和由此支出的所有费用（包括但不限于诉讼费、公证费、律师费、差旅费），不足部分，继续向买方追偿。
                    </div>
                    <div class="conIndent"> 3、商品在无信号地区连续工作61天会自动锁机（51天和58天时会自动发出锁车警告）。</div>
                    <div class="conIndent"> 4、如买方采用承兑方式支付商品款，则卖方有权按照银行实时利率对买方收取贴现利息。</div>
                    <div class="conIndent">
                        5、如商品保险期间出险，由买方自行向保险公司索赔，卖方仅有协助义务,并不承担任何相关责任。如买方拒绝在卖方处对出险商品进行维修或买方不能在出险一个月内提供完整的理赔所需资料，卖方有权拒绝协助理赔。
                    </div>
                    <div class="conIndent">
                        6、在买方付清所有的商品款后，卖方向买方出具正规发票（发票上的付款人与收款人的名称与本合同买卖双方的名称一致），买方不得以任何理由要求卖方更改发票上的名称，否则卖方有权拒开。
                    </div>
                    <div class="conIndent"> 7、若设备出现故障、毁损、灭失等风险，由买方自行承担相应的损失，与卖方无关。</div>
                    <div class="conIndent"> 8、发票开票信息要求：付款方与发票受票方名称需一致。</div>
                    <div class="conIndent"> 9、本合同应显示卖方名称水印，如无水印，则合同无效。</div>
                </template>

                <!--一裤衩条款-->
                <template v-if="buyType=='融资租赁'">
                    <!--付款方式-->
                    <!--<div class="bigTitle"> {{getNumber('条款','2')}}、付款方式：</div>-->
                    <!--<div class="conIndent">-->
                    <!--1、买方采用融资租赁方式购买，在卖方设备到达买方指定地点前一次性结清首付款项。-->
                    <!--</div>-->
                    <!--<div class="conIndent">-->
                    <!--2、 如果买方发生款项逾期时，需按月利率1%，不足整月按日利率0.03%支付给卖方逾期利息。-->
                    <!--</div>-->
                    <!--其他约定事项-->
                    <div class="bigTitle"> {{getNumber('条款','5')}}、其他约定事项：</div>
                    <div class="conIndent">
                        1、买方不得以商品质量和服务为由拒付商品款或融资租赁款，否则卖方有权停止一切配件供应和服务工作，并不承担任何责任。
                    </div>
                    <div class="conIndent">
                        2、买方委托卖方为其与<span style="color:red;">{{contract.main.financeCompany}}</span>签署的《融资租赁协议》项下债务提供连带担保。担保期限自《融资租赁协议》生效起至最后一笔租金届满后的两年。
                    </div>
                    <div class="conIndent">
                        3、买方未按时向<span style="color:red;">{{contract.main.financeCompany}}</span>支付租金，卖方承担了担保责任，代买方垫付了租金（包含本金、利息、罚息等），买方自卖方垫付之日起按日万分之五向卖方支付利息。
                    </div>
                    <div class="conIndent">
                        4、如果买方未按时支付商品款，卖方可随时通过GPS将该设备停机并收回该设备，并要求买方结清全部商品欠款、赔偿其它损失。在收回商品60日内买方还未支付所欠全部商品欠款和各种税费时，卖方无需翻新、修理即可直接处置设备，销售对象为任何需要设备的法人或自然人，以销售所得作为设备的处置价款，买方确认卖方的上述设备处置方式和处置所得价款，不存在任何异议。所得价款优先用于偿付买方所欠全部垫付款项、各种税费（含收回商品后产生的税费）、其它损失和由此支出的所有费用（包括但不限于诉讼费、公证费、律师费、差旅费），不足部分，继续向买方追偿。
                    </div>
                    <div class="conIndent">
                        5、在本合同第五条第3、4项发生时，卖方有权直接向买方追偿欠款及其它费用或采取法律途径追偿欠款及其它费用。
                    </div>
                    <div class="conIndent">
                        6、商品在无信号地区连续工作61天会自动锁机（51天和58天时会自动发出锁车警告）。
                    </div>
                    <div class="conIndent">
                        7、该商品的保险生效日期为商品交付并买方提供有效身份证复印件之后的第二个工作日（法定节假日顺延），在此期间如果该商品发生损坏，全部风险由买方承担。
                    </div>
                    <div class="conIndent">
                        8、如商品保险期间出险，由买方自行向保险公司索赔，卖方仅有协助义务,并不承担任何相关责任。如买方拒绝在卖方处对出险商品进行维修或买方不能在出险一个月内提供完整的理赔所需资料，卖方有权拒绝协助理赔。
                    </div>
                    <div class="conIndent">
                        9、如买方采用承兑方式支付商品款或融资租赁款，则卖方有权按照银行实时利率对买方收取贴现利息。
                    </div>
                    <div class="conIndent">
                        10、设备到达指定地点七日内，买方未提供完整融资手续，卖方有权通过GPS停机。
                    </div>
                    <div class="conIndent">
                        11、发票开票信息要求：付款方与发票受票方名称需一致。
                    </div>
                    <div class="conIndent">
                        12、本合同应显示卖方名称水印，如无水印，则合同无效。
                    </div>
                </template>

                <!--一裤衩条款-->
                <template v-if="buyType=='融资租赁打包'">
                    <!--付款方式-->
                    <!--<div class="bigTitle"> {{getNumber('条款','5')}}、付款方式：</div>-->
                    <!--<div class="conIndent">-->
                    <!--1、买方采用融资租赁方式购买，在卖方设备到达买方指定地点前一次性结清首付款项。-->
                    <!--</div>-->
                    <!--<div class="conIndent">-->
                    <!--2、 如果买方发生款项逾期时，需按月利率1%，不足整月按日利率0.03%支付给卖方逾期利息。-->
                    <!--</div>-->
                    <!--其他约定事项-->
                    <div class="bigTitle"> {{getNumber('条款','5')}}、其他约定事项：</div>
                    <div class="conIndent">
                        1、买方不得以商品质量和服务为由拒付商品款或融资租赁款，否则卖方有权停止一切配件供应和服务工作，并不承担任何责任。
                    </div>
                    <div class="conIndent">
                        2、买方委托卖方为其与<span style="color:red;">{{contract.main.financeCompany}}</span>签署的《融资租赁协议》项下债务提供连带担保。担保期限自《融资租赁协议》生效起至最后一笔租金届满后的两年。
                    </div>
                    <div class="conIndent">
                        3、买方未按时向<span style="color:red;">{{contract.main.financeCompany}}</span>支付租金，卖方承担了担保责任，代买方垫付了租金（包含本金、利息、罚息等），买方自卖方垫付之日起按日万分之五向卖方支付利息。
                    </div>
                    <div class="conIndent">
                        4、如果买方未按时支付商品款，卖方可随时通过GPS将该设备停机并收回该设备，并要求买方结清全部商品欠款、赔偿其它损失。在收回商品60日内买方还未支付所欠全部商品欠款和各种税费时，卖方无需翻新、修理即可直接处置设备，销售对象为任何需要设备的法人或自然人，以销售所得作为设备的处置价款，买方确认卖方的上述设备处置方式和处置所得价款，不存在任何异议。所得价款优先用于偿付买方所欠全部垫付款项、各种税费（含收回商品后产生的税费）、其它损失和由此支出的所有费用（包括但不限于诉讼费、公证费、律师费、差旅费），不足部分，继续向买方追偿。
                    </div>
                    <div class="conIndent">
                        5、在本合同第五条第3、4项发生时，卖方有权直接向买方追偿欠款及其它费用或采取法律途径追偿欠款及其它费用。
                    </div>
                    <div class="conIndent">
                        6、商品在无信号地区连续工作61天会自动锁机（51天和58天时会自动发出锁车警告）。
                    </div>
                    <div class="conIndent">
                        7、该商品的保险生效日期为商品交付并买方提供有效身份证复印件之后的第二个工作日（法定节假日顺延），在此期间如果该商品发生损坏，全部风险由买方承担。
                    </div>
                    <div class="conIndent">
                        8、如商品保险期间出险，由买方自行向保险公司索赔，卖方仅有协助义务,并不承担任何相关责任。如买方拒绝在卖方处对出险商品进行维修或买方不能在出险一个月内提供完整的理赔所需资料，卖方有权拒绝协助理赔。
                    </div>
                    <div class="conIndent">
                        9、如买方采用承兑方式支付商品款或融资租赁款，则卖方有权按照银行实时利率对买方收取贴现利息。
                    </div>
                    <div class="conIndent">
                        10、设备到达指定地点七日内，买方未提供完整融资手续，卖方有权通过GPS停机。
                    </div>
                    <div class="conIndent">
                        11、发票开票信息要求：付款方与发票受票方名称需一致。
                    </div>
                    <div class="conIndent">
                        12、本合同应显示卖方名称水印，如无水印，则合同无效。
                    </div>
                </template>

                <!-- 自定义三条-->
                <v-edit-div style="border:none;border-bottom: 1px solid red;color: red;text-indent: 28px;"
                            type="text" v-for="(item,i) in contract.contractTermsList"
                            v-if="pageType!='look'" v-model="item.contractTerms"></v-edit-div>
                <div class="conIndent" v-for="(item,i) in contract.contractTermsList"
                     v-if="pageType=='look'&&item.contractTerms.length-item.contractTerms.indexOf('、')>1">
                    <span style="border:none;color: red;">{{item.contractTerms}}</span>
                </div>

                <!--  诉讼条款-->
                <div class="bigTitle"> {{getNumber('条款','6')}}、诉讼条款：</div>
                <div class="conIndent">
                    因履行本合同所发生的一切争议，双方应通过友好协商解决；如果协商不成可向卖方所在地法院起诉处理。除了在诉讼过程中进行的诉讼部分外，合同仍继续履行。
                </div>
                <div class="bigTitle" v-if="buyType=='内部分期'">{{getNumber('条款','7')}}、本合同自双方签字之日起生效，合同正本共贰份，由买卖双方各执壹份。
                </div>
                <div class="bigTitle" v-else-if="buyType=='全款'">
                    {{getNumber('条款','7')}}、本合同自双方签字之日起生效，合同正本共贰份，由买卖双方各执壹份。
                </div>
                <div class="bigTitle" v-else-if="buyType=='融资租赁'">
                    {{getNumber('条款','7')}}、本合同自双方签字盖章之日起生效，合同正本共叁份，由买卖双方和融资机构各执壹份。
                </div>
                <div class="bigTitle" v-else-if="buyType=='融资租赁打包'">
                    {{getNumber('条款','7')}}、本合同自双方签字盖章之日起生效，合同正本共叁份，由买卖双方和融资机构各执壹份。
                </div>
            </template>

            <!--旧机-->
            <template v-else>
                <!--旧机销售合同-->
                <template>
                    <div class="bigTitle">二、产品及商务条件：
                    </div>
                    <table class="conTable table-detail" cellspacing="0" cellpadding="0">
                        <tr>
                            <td class="td-title" style="width: 15%;">品牌</td>
                            <td class="td-value" style="width: 35%;">
                                <input type="text" v-if="pageType!='look'"
                                       v-model="contract.main.brandName"/>
                                <span v-else>{{contract.main.brandName}}</span>
                            </td>
                            <td style="width: 15%;" class="td-title">制造商</td>
                            <td class="td-value" style="width: 35%;">
                                <input type="text" v-if="pageType!='look'"
                                       v-model="contract.main.manufacturer"/>
                                <span v-else>{{contract.main.manufacturer}}</span>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 15%;" class="td-title">型号</td>
                            <td class="td-value" style="width: 35%;">
                                <input type="text" v-if="pageType!='look'"
                                       v-model="contract.main.modelName"/>
                                <span v-else>{{contract.main.modelName}}</span>
                            </td>
                            <td style="width:15%;" class="td-title">设备类型</td>
                            <td class="td-value" style="width: 35%;">
                                <input type="text" v-if="pageType!='look'"
                                       v-model="contract.main.deviceType"/>
                                <span v-else>{{contract.main.deviceType}}</span>
                            </td>

                        </tr>
                        <tr>
                            <td style="width: 15%;" class="td-title">序列号</td>
                            <td class="td-value" style="width: 35%;">
                                <input type="text" v-if="pageType!='look'"
                                       v-model="contract.main.serialNo"/>
                                <span v-else>{{contract.main.serialNo}}</span>
                            </td>
                            <td class="td-title">数量</td>
                            <td class="td-value">
                                <span>{{contract.sales.dealNo}}</span>
                            </td>
                        </tr>
                        <tr>
                            <td class="td-title">单价</td>
                            <td class="td-value">
                                <input v-if="pageType!='look'" type="text"
                                       @blur="strFormat($event.target,'contract.sales.unitPrice')"
                                       @focus="strFormatF($event.target,'contract.sales.unitPrice')"
                                       v-onedate="fmoney(contract.sales.unitPrice)"/>
                                <span v-else>{{fmoney(contract.sales.unitPrice)}}</span>
                                <span style="color: red;position:absolute;left:105px;top: 4px;">元</span>
                            </td>
                            <!--<td class="td-title">不含税金额</td>-->
                            <!--<td class="td-value">-->
                                <!--<span>{{fmoney((contract.sales.unitPrice/1.13))}}</span>-->
                                <!--<span style="color: red;position:absolute;left:105px;top: 4px;">元</span>-->
                            <!--</td>-->
                            <td class="td-title">总价</td>
                            <td class="td-value">
                                <span>{{getSalesTotalPrice}}</span>
                                <span style="color: red;position:absolute;left:105px;top: 4px;">元</span>
                            </td>
                        </tr>
                        <!--<tr>-->
                            <!--<td class="td-title">增值税税额（13%）</td>-->
                            <!--<td class="td-value">-->
                                <!--<span>{{fmoney((contract.sales.unitPrice-(contract.sales.unitPrice/1.13)))}}</span>-->
                                <!--<span style="color: red;position:absolute;left:105px;top: 4px;">元</span>-->
                            <!--</td>-->
                            <!--<td class="td-title">总价</td>-->
                            <!--<td class="td-value">-->
                                <!--<span>{{getSalesTotalPrice}}</span>-->
                                <!--<span style="color: red;position:absolute;left:105px;top: 4px;">元</span>-->
                            <!--</td>-->
                        <!--</tr>-->
                        <tr>
                            <td class="td-title" style="width: 15%;">合计</td>
                            <td class="td-value" style="width: 85%;" colspan="3">
                                <input v-if="pageType!='look'" type="text"
                                       @blur="strFormat($event.target,'contract.sales.total')"
                                       @focus="strFormatF($event.target,'contract.sales.total')"
                                       v-onedate="fmoney(contract.sales.total)"/>
                                <span v-else>{{fmoney(contract.sales.total)}}</span>
                                <!-- <span>{{getSalesTotal}}</span>-->
                                <span style="color: red;position:absolute;left:105px;top: 4px;">元</span>
                                <span style="color: #bbb;position:absolute;left:125px;top: 4px;">(总价+其他费用)</span>
                            </td>
                        </tr>
                    </table>
                    <div class="conIndent">1、买方采用全款方式购买；在卖方设备到达买方指定地点前，一次性结清所有款项。</div>
                    <div class="conIndent">2、如果买方还款发生款项逾期时，需按到期本息合计金额的月利率2%（不足整月按日利率0.07%）支付逾期利息。</div>
                </template>
                <template>
                    <div class="bigTitle"> 三、付款方式：</div>
                    <div class="conIndent">
                        1、买方采用全款方式购买，在卖方设备到达买方指定地点前，一次性结清所有款项。
                    </div>
                    <div class="conIndent">
                        2、买方发生款项逾期时，需按日利率0.1%支付卖方逾期利息。
                    </div>
                </template>
                <!--旧机 其他条款-->
                <template>
                    <div class="bigTitle">四、其他约定事项：</div>
                    <div class="conIndent" v-if="haveWarranty==1">
                        1、因所购设备为二手设备，交车验车后,该车保养、维修等全部费用由买方承担，卖方不承担任何费用。卖方提供的质保范围详见《质保协议》。
                    </div>
                    <div class="conIndent" v-if="haveWarranty==0">
                        1、因所购设备为二手设备，卖方不提供任何质保承诺，交车验车后,该车保养、维修等全部费用由买方承担，卖方不承担任何费用。
                    </div>
                    <div class="conIndent">2、如买方采用承兑方式支付商品款，则卖方按照银行实时利率对买方收取贴现利息。</div>
                    <div class="conIndent">3、买方需在交车前向卖方提供本人身份证复印件。</div>
                    <div class="conIndent">
                        4、在买方没有付清全部货款以前，该设备所有权始终属于卖方，由于买方不按期支付货款而发生的拖车费、律师费、法院起诉费、法院执行费等所有费用均有买方承担，卖方不承担任何费用。
                    </div>
                    <div class="conIndent">5、发票开票信息要求：付款方与发票受票方名称需一致。</div>
                    <div class="conIndent">6、本合同应显示卖方名称水印，如无水印，则合同无效。</div>
                    <!-- 自定义三条-->
                    <v-edit-div style="border:none;border-bottom: 1px solid red;color: red;text-indent: 28px;"
                                type="text" v-for="(item,i) in contract.contractTermsList"
                                v-if="pageType!='look'" v-model="item.contractTerms"></v-edit-div>
                    <div class="conIndent" v-for="(item,i) in contract.contractTermsList"
                         v-if="pageType=='look'&&item.contractTerms.length-item.contractTerms.indexOf('、')>1">
                        <span style="border:none;color: red;">{{item.contractTerms}}</span>
                    </div>
                    <div class="bigTitle">五、诉讼条款：</div>
                    <div class="conIndent">因履行本合同所发生的一切争议，双方应通过友好协商解决；如果协商不成可向卖方所在地法院起诉处理。除了在诉讼过程中进行的诉讼部分外，合同仍继续履行。
                    </div>
                    <!--<div class="bigTitle">六、其他约定事项：</div>-->
                    <!--<div class="conIndent">-->
                    <!--1、在买方没有付清全部货款以前，该设备所有权始终属于卖方，由于买方不按期支付货款而发生的拖车费、律师费、法院起诉费、法院执行费等所有费用均有买方承担，卖方不承担任何费用。-->
                    <!--</div>-->
                    <!--<div class="conIndent">-->
                    <!--2、发票开票信息要求：付款方与发票受票方名称需一致。-->
                    <!--</div>-->
                    <!--<div class="conIndent">-->
                    <!--3、本合同应显示卖方名称水印，如无水印，则合同无效。-->
                    <!--</div>-->
                    <!-- <div class="conIndent" v-for="(item,i) in contract.contractTermsList"
                          v-if="pageType!='look'">
                         <v-edit-div style="border:none;border-bottom: 1px solid red;color: red;" type="text"
                                     v-model="item.contractTerms"></v-edit-div>
                     </div>
                     <div class="conIndent" v-for="(item,i) in contract.contractTermsList"
                          v-if="pageType=='look'&&item.contractTerms">
                         <span style="border:none;color: red;">{{item.contractTerms}}</span>
                     </div>-->
                    <!--<v-edit-div style="border:none;border-bottom: 1px solid red;color: red;text-indent: 28px;"-->
                    <!--type="text" v-for="(item,i) in contract.contractTermsList"-->
                    <!--v-if="pageType!='look'" v-model="item.contractTerms"></v-edit-div>-->
                    <!--<div class="conIndent" v-for="(item,i) in contract.contractTermsList"-->
                    <!--v-if="pageType=='look'&&item.contractTerms.length-item.contractTerms.indexOf('、')>1">-->
                    <!--<span style="border:none;color: red;">{{item.contractTerms}}</span>-->
                    <!--</div>-->
                    <div class="bigTitle">六、本合同自双方签字之日起生效，合同正本共贰份，由买卖双方各执壹份。</div>
                </template>
            </template>

            <!--签字1-->
            <div class="sign" style="overflow: hidden">
                <div class="left">
                    <div class="item" style="margin-bottom: 7px;">
                        <div class="title">卖方（盖章）：</div>
                        <div class="value">{{contract.main.seller}}</div>
                    </div>
                    <div class="item" style="margin-bottom: 7px;">
                        <div class="title">签字：</div>
                    </div>
                    <div class="item" style="margin-bottom: 7px;">
                        <div class="title">日期：</div>
                    </div>
                </div>
                <div class="right" style="float: right;">
                    <div class="item" style="margin-bottom: 7px;">
                        <div class="title">买方（盖章）：</div>
                        <div class="value">{{contract.main.buyer}}</div>
                    </div>
                    <div v-if="buyType!='全款'&&contractType!='2'">
                        <div class="item" style="margin-bottom: 7px;">
                            <div class="title">配偶人签字：</div>
                        </div>
                    </div>
                    <div class="item" style="margin-bottom: 7px;">
                        <div class="title">签字：</div>
                    </div>
                    <div class="item" style="margin-bottom: 7px;">
                        <div class="title">日期：</div>
                    </div>
                    <div v-if="buyType!='全款'&&contractType!='2'">
                        <template v-for="(item,i) in contract.guarantorList">
                            <div class="item" style="margin-bottom: 7px;"
                                 v-if="item.guarantor&&item.guarantor!='无'">
                                <div class="title">担保方({{getNumber('',i+1)}})（盖章）：</div>
                                <div class="value">{{item.guarantor}}</div>
                            </div>
                            <div class="item" style="margin-bottom: 7px;"
                                 v-if="item.guarantor&&item.guarantor!='无'">
                                <div class="title">担保方配偶：</div>
                            </div>
                            <div class="item" style="margin-bottom: 7px;"
                                 v-if="item.guarantor&&item.guarantor!='无'">
                                <div class="title">签字：</div>
                            </div>
                        </template>
                        <div class="item" style="margin-bottom: 7px ;"
                             v-if="contract.guarantorList[0].guarantor!='无'&&contract.guarantorList[0].guarantor">
                            <div class="title">日期：</div>
                        </div>
                    </div>
                </div>
            </div>

            <!--以旧换新条款-->
            <template v-if="zhihuan=='1'">
                <div class="conTitle" style="margin-top:30px ;">以旧换新协议</div>
                <table class="conTable table-detail" cellspacing="0" cellpadding="0" style="margin-top:28px ;">
                    <tr>
                        <td class="td-title" style="width: 15%;">甲方</td>
                        <td class="td-value" style="width: 35%;">
                            <span>{{contract.main.seller}}</span>
                        </td>
                        <td class="td-title" style="width: 15%;">乙方(公司名称)</td>
                        <td class="td-value" style="width: 35%;">
                            <span>{{contract.main.buyer}}</span>
                        </td>
                    </tr>
                    <tr>
                        <!--<td>税号</td>
                        <td class="td-value">{{contract.main.sellerTaxNo}}</td>-->
                        <td class="td-title" style="position: static;">地址</td>
                        <td class="td-value"><span>{{contract.main.sellerAddress}}</span></td>
                        <td class="td-title">身份证号(公司税号)</td>
                        <td class="td-value">
                            <input type="text" v-if="pageType!='look'"
                                   v-model="contract.main.buyerTaxNo"/>
                            <span v-else>{{contract.main.buyerTaxNo}}</span>
                        </td>
                    </tr>
                    <tr>
                        <td class="td-title">联系电话</td>
                        <td class="td-value">{{contract.main.sellerTel}}</td>
                        <td class="td-title">地址</td>
                        <td class="td-value">
                            <input type="text" v-if="pageType!='look'"
                                   v-model="contract.main.buyerAddress"/>
                            <span v-else>{{contract.main.buyerAddress}}</span>
                        </td>
                    </tr>
                    <tr>
                        <td class="td-title">传真</td>
                        <td class="td-value">{{contract.main.sellerFax}}</td>
                        <td class="td-title">联系电话</td>
                        <td class="td-value">
                            <input type="text" v-if="pageType!='look'"
                                   v-model="contract.main.buyerTel"/>
                            <span v-else>{{contract.main.buyerTel}}</span>
                        </td>
                    </tr>
                </table>
                <template v-if="buyType!='全款'&&contractType!='2'">
                    <div style="height: 28px;position: relative;width: 100%;line-height: 20px;">
                        <span v-if="pageType!='look'"
                              style="position: absolute;right: 0px;top:2px;text-align: center">
                                    <!--<a class="a-btn"-->
                                       <!--@click="addRow('guarantorList','guarantorTem')">增加担保方</a>-->
                                     <!--<a class="a-btn"-->
                                        <!--@click="delRow('guarantorList')">删除担保方</a>-->
                        </span>
                    </div>
                    <table class="conTable table-detail" cellspacing="0" cellpadding="0"
                           v-for="(item,i) in contract.guarantorList">
                        <tr>
                            <td class="td-title twoLine" style="width: 15%;">

                                担保方({{getNumber('',i+1)}})</br>(公司名称)
                            </td>
                            <td class="td-value" style="width: 85%;">
                                <input type="text" v-if="pageType!='look'"
                                       v-model="item.guarantor"/>
                                <span v-else>{{item.guarantor}}</span>
                            </td>
                        </tr>
                        <tr>
                            <td class="td-title twoLine">身份证号(公司税号)</td>
                            <td class="td-value">
                                <input type="text" v-if="pageType!='look'"
                                       v-model="item.guarantorTaxNo"/>
                                <span v-else>{{item.guarantorTaxNo}}</span>
                            </td>
                        </tr>
                        <tr>
                            <td class="td-title">地址</td>
                            <td class="td-value">
                                <input type="text" v-if="pageType!='look'"
                                       v-model="item.guarantorAddress"/>
                                <span v-else>{{item.guarantorAddress}}</span>
                            </td>
                        </tr>
                        <tr>
                            <td class="td-title">联系电话</td>
                            <td class="td-value">
                                <input type="text" v-if="pageType!='look'"
                                       v-model="item.guarantorTel"/>
                                <span v-else>{{item.guarantorTel}}</span>
                            </td>
                        </tr>
                    </table>
                </template>
                <div class="conIndent" style="overflow: hidden">
                    1、因乙方资金不足，甲方允许乙方用{{contract.replacement.replacementsChineseName}}以旧换新，抵顶给甲方用于冲抵销售合同(<span
                        style="color:red;" v-if="contract.main.contractNo">{{contract.main.contractNo}}</span>
                    <span v-else style="color: red;">合同创建成功后自动生成</span>)项下的新机设备部分款项，具体信息如下：
                </div>
                <template v-if="pageType!='look'">
                    <label>挖掘机<input type="checkbox" style="margin-top: 8px !important;" value="旧机置换"
                                     :checked="(contract.replacement.replacementsName).indexOf('wjj')>=0"
                                     @click.prevent="checkedOne('wjj')"/></label>
                    <label>装载机<input type="checkbox" style="margin-top: 8px !important;" value="旧机置换"
                                     :checked="(contract.replacement.replacementsName).indexOf('zzj')>=0"
                                     @click.prevent="checkedOne('zzj')"/></label>
                    <label>旧汽车<input type="checkbox" value="旧汽车" style="margin-top: 8px !important;"
                                     :checked="(contract.replacement.replacementsName).indexOf('qiChe')>=0"
                                     @click.prevent="checkedOne('qiChe')" v-if="pageType!='look'"/></label>
                    <label>旧商品房<input type="checkbox" value="旧商品房" style="margin-top: 8px !important;"
                                      :checked="(contract.replacement.replacementsName).indexOf('fangWu')>=0"
                                      @click.prevent="checkedOne('fangWu','旧商品房')"
                                      v-if="pageType!='look'"/></label>
                    <label>其他<input type="checkbox" value="其他" style="margin-top: 8px !important;"
                                    :checked="(contract.replacement.replacementsName).indexOf('other')>=0"
                                    @click.prevent="checkedOne('other')" v-if="pageType!='look'"/></label>
                </template>
                <template v-if="(contract.replacement.replacementsName).indexOf('wjj')>=0"
                          v-for="(item,i) in contract.replacement.wjj">
                    <div style="text-align: center;position: relative;height:28px;"><span
                            style="float:left; position: absolute;left:0px;">挖掘机置换信息({{getNumber('',i+1)}})：</span>
                        <span v-if="pageType!='look'&&i===0"
                              style="color:#2a8cec;position: absolute;right: 0px;top:4px;line-height:20px;text-align: center;font-weight: bold;">
                            <!--<span style="font-size:14px; cursor: pointer;position: absolute;color: #fff;width: 94px;padding:0 4px;background:rgb(71, 150, 229);border-radius: 5px;right: 0px;"-->
                            <!--@click="addRow('wjj','jiuJi','挖掘机')" >增加置换设备</span>-->
                            <!--<span style="font-size:14px; cursor: pointer;position: absolute;color: #fff;width: 94px;padding:0 4px;background:red;border-radius: 5px;right: 0px;"-->
                            <!--@click="delRow('wjj',i)" v-else>删除置换设备</span>-->
                            <a class="a-btn"
                               @click="addRow('wjj','jiuJi','挖掘机')">增加置换设备</a>
                            <a class="a-btn"
                               @click="delRow('wjj')">删除置换设备</a>
                        </span>
                    </div>
                    <table class="conTable table-detail" cellspacing="0" cellpadding="0">
                        <tr>
                            <td class="td-title" style="width: 15%;">
                                设备生产商
                            </td>
                            <td class="td-value" style="width: 35%;">
                                <input type="text" v-if="pageType!='look'"
                                       v-model="item.manufacturer"/>
                                <span v-else>{{item.manufacturer}}</span>
                            </td>
                            <td class="td-title" style="width: 15%;">品牌</td>
                            <td class="td-value" style="width: 35%;">
                                <input type="text" v-if="pageType!='look'"
                                       v-model="item.brandName"/>
                                <span v-else>{{item.brandName}}</span>
                            </td>
                        </tr>
                        <tr>
                            <td class="td-title">型号</td>
                            <td class="td-value">
                                <input type="text" v-if="pageType!='look'"
                                       v-model="item.modelName"/>
                                <span v-else>{{item.modelName}}</span>
                            </td>
                            <td class="td-title">序列号</td>
                            <td class="td-value"><input type="text" v-if="pageType!='look'"
                                                        v-model="item.sequence"/>
                                <span v-else>{{item.sequence}}</span></td>
                        </tr>
                        <tr>

                            <td class="td-title">出厂年份</td>
                            <td class="td-value"><input type="text" v-if="pageType!='look'"
                                                        v-model="item.factoryDate"
                                                        @focus="showDatePickerYear($event,item,i)"/>
                                <span v-else>{{item.factoryDate}}</span></td>
                            <td class="td-title">小时数</td>
                            <td class="td-value"><input type="text" v-if="pageType!='look'"
                                                        placeholder="只能输入数字，如果不详请填写0"
                                                        onkeyup="(this.v=function(){this.value=this.value.replace(/[^\d^\.]+/g,'');}).call(this)"
                                                        onblur="this.v();" v-model="item.hours"/>
                                <span v-else>{{item.hours&&item.hours!=0.00&&item.hours!=0?item.hours:'未知'}}</span></td>
                        </tr>
                        <tr>
                            <td class="td-title">置换价格</td>
                            <td class="td-value" colspan="3">
                                <input v-if="pageType!='look'" type="text"
                                       @blur="strFormat($event.target,'contract.replacement.wjj.'+i+'.replacementPrice')"
                                       @focus="strFormatF($event.target,'contract.replacement.wjj.'+i+'.replacementPrice')"
                                       v-onedate="fmoney(item.replacementPrice)"/>
                                <!--<input v-if="pageType!='look'" type="number"-->
                                <!--v-model.number="item.replacementPrice"/>-->
                                <span v-else>{{fmoney(item.replacementPrice)}}</span>
                                <span style="color: red;position:absolute;left:105px;top: 4px;">元</span>
                            </td>
                        </tr>
                    </table>
                </template>
                <template v-if="(contract.replacement.replacementsName).indexOf('zzj')>=0"
                          v-for="(item,i) in contract.replacement.zzj">
                    <div style="text-align: center;position: relative;height:28px;"><span
                            style="float:left; position: absolute;left:0px;">装载机置换信息({{getNumber('',i+1)}})：</span>
                        <span v-if="pageType!='look'&&i===0"
                              style="color:#2a8cec;position: absolute;right: 0px;top:4px;line-height:20px;text-align: center;font-weight: bold;">
                            <!--<span style="font-size:14px; cursor: pointer;position: absolute;color: #fff;width: 94px;padding:0 4px;background:rgb(71, 150, 229);border-radius: 5px;right: 0px;"-->
                            <!--@click="addRow('zzj','jiuJi','装载机')" v-if="i==0">增加置换设备</span>-->
                            <!--<span style="font-size:14px; cursor: pointer;position: absolute;color: #fff;width: 94px;padding:0 4px;background:red;border-radius: 5px;right: 0px;"-->
                            <!--@click="delRow('zzj',i)" v-else>删除置换设备</span>-->
                            <a class="a-btn"
                               @click="addRow('zzj','jiuJi','装载机')">增加置换设备</a>
                            <a class="a-btn"
                               @click="delRow('zzj')">删除置换设备</a>
                        </span>
                    </div>
                    <table class="conTable table-detail" cellspacing="0" cellpadding="0">
                        <tr>
                            <td class="td-title" style="width: 15%;">
                                设备生产商
                            </td>
                            <td class="td-value" style="width: 35%;">
                                <input type="text" v-if="pageType!='look'"
                                       v-model="item.manufacturer"/>
                                <span v-else>{{item.manufacturer}}</span>
                            </td>
                            <td class="td-title" style="width: 15%;">品牌</td>
                            <td class="td-value" style="width: 35%;">
                                <input type="text" v-if="pageType!='look'"
                                       v-model="item.brandName"/>
                                <span v-else>{{item.brandName}}</span>
                            </td>
                        </tr>
                        <tr>
                            <td class="td-title">型号</td>
                            <td class="td-value">
                                <input type="text" v-if="pageType!='look'"
                                       v-model="item.modelName"/>
                                <span v-else>{{item.modelName}}</span>
                            </td>
                            <td class="td-title">序列号</td>
                            <td class="td-value"><input type="text" v-if="pageType!='look'"
                                                        v-model="item.sequence"/>
                                <span v-else>{{item.sequence}}</span></td>
                        </tr>
                        <tr>

                            <td class="td-title">出厂年份</td>
                            <td class="td-value"><input type="text" v-if="pageType!='look'"
                                                        v-model="item.factoryDate"
                                                        @focus="showDatePickerYear($event,item)"/>
                                <span v-else>{{item.factoryDate}}</span></td>
                            <td class="td-title">小时数</td>
                            <td class="td-value"><input type="text" v-if="pageType!='look'"
                                                        placeholder="只能输入数字，如果不详请填写0"
                                                        onkeyup="(this.v=function(){this.value=this.value.replace(/[^\d^\.]+/g,'');}).call(this)"
                                                        onblur="this.v();"
                                                        v-model="item.hours"/>
                                <span v-else>{{item.hours&&item.hours!=0.00&&item.hours!=0?item.hours:'未知'}}</span></td>
                        </tr>
                        <tr>
                            <td class="td-title">置换价格</td>
                            <td class="td-value" colspan="3">
                                <input v-if="pageType!='look'" type="text"
                                       @blur="strFormat($event.target,'contract.replacement.zzj.'+i+'.replacementPrice')"
                                       @focus="strFormatF($event.target,'contract.replacement.zzj.'+i+'.replacementPrice')"
                                       v-onedate="fmoney(item.replacementPrice)"/>
                                <span v-else>{{fmoney(item.replacementPrice)}}</span>
                                <span style="color: red;position:absolute;left:105px;top: 4px;">元</span>
                            </td>
                        </tr>
                    </table>
                </template>
                <template v-if="(contract.replacement.replacementsName).indexOf('qiChe')>=0"
                          v-for="(item,i) in contract.replacement.qiChe">
                    <div style="text-align: center;position: relative;height:28px;"><span
                            style="float:left; position: absolute;left:0px;">旧汽车置换信息({{getNumber('',i+1)}})：</span>
                        <span v-if="pageType!='look'&&i===0"
                              style="color:#2a8cec;position: absolute;right: 0px;top:4px;line-height:20px;text-align: center;font-weight: bold;">
                            <!--<span style="font-size:14px; cursor: pointer;position: absolute;color: #fff;width: 80px;border-radius: 5px;right: 0px;padding:0 4px;background:rgb(71, 150, 229);"-->
                            <!--@click="addRow('qiChe','qiChe','装载机')" v-if="i==0">增加旧汽车</span>-->
                            <!--<span style="font-size:14px; cursor: pointer;position: absolute;color: #fff;width: 80px;border-radius: 5px;right: 0px;padding:0 4px;background:red;"-->
                            <!--@click="delRow('qiChe',i)" v-else>删除旧汽车</span>-->
                             <a class="a-btn"
                                @click="addRow('qiChe','qiChe')">增加旧汽车</a>
                            <a class="a-btn"
                               @click="delRow('qiChe')">删除旧汽车</a>
                        </span>
                    </div>
                    <table class="conTable table-detail" cellspacing="0" cellpadding="0">
                        <tr>
                            <td class="td-title" style="width: 15%;">
                                汽车生产商
                            </td>
                            <td class="td-value" style="width: 35%;">
                                <input type="text" v-if="pageType!='look'"
                                       v-model="item.manufacturer"/>
                                <span v-else>{{item.manufacturer}}</span>
                            </td>
                            <td class="td-title" style="width: 15%;">汽车类型</td>
                            <td class="td-value" style="width: 35%;">
                                <input type="text" v-if="pageType!='look'"
                                       v-model="item.replacementType"/>
                                <span v-else>{{item.replacementType}}</span>

                            </td>
                        </tr>
                        <tr>
                            <td class="td-title" style="width: 15%;">品牌</td>
                            <td class="td-value" style="width: 35%;">
                                <input type="text" v-if="pageType!='look'"
                                       v-model="item.brandName"/>
                                <span v-else>{{item.brandName}}</span>
                            </td>
                            <td class="td-title">型号</td>
                            <td class="td-value">
                                <input type="text" v-if="pageType!='look'"
                                       v-model="item.modelName"/>
                                <span v-else>{{item.modelName}}</span>
                            </td>
                        </tr>
                        <tr>

                            <td class="td-title">出厂年份</td>
                            <td class="td-value"><input type="text" v-if="pageType!='look'"
                                                        v-model="item.factoryDate"
                                                        @focus="showDatePickerYear($event,item)"/>
                                <span v-else>{{item.factoryDate}}</span></td>
                            <td class="td-title">公里数</td>
                            <td class="td-value"><input type="text" v-if="pageType!='look'"
                                                        placeholder="只能输入数字，如果不详请填写0"
                                                        onkeyup="(this.v=function(){this.value=this.value.replace(/[^0-9-]+/,'');}).call(this)"
                                                        onblur="this.v();"
                                                        v-model="item.kilometers"/>
                                <span v-else>{{item.kilometers}}</span></td>
                        </tr>
                        <tr>
                            <td class="td-title">置换价格</td>
                            <td class="td-value" colspan="3">
                                <input v-if="pageType!='look'" type="text"
                                       @blur="strFormat($event.target,'contract.replacement.qiChe.'+i+'.replacementPrice')"
                                       @focus="strFormatF($event.target,'contract.replacement.qiChe.'+i+'.replacementPrice')"
                                       v-onedate="fmoney(item.replacementPrice)"/>
                                <span v-else>{{fmoney(item.replacementPrice)}}</span>
                                <span style="color: red;position:absolute;left:105px;top: 4px;">元</span>
                            </td>
                        </tr>
                    </table>
                </template>
                <template v-if="(contract.replacement.replacementsName).indexOf('fangWu')>=0"
                          v-for="(item,i) in contract.replacement.fangWu">

                    <div style="text-align: center;position: relative;height:28px;"><span
                            style="float:left; position: absolute;left:0px;">旧商品房置换信息({{getNumber('',i+1)}})：</span>
                        <span v-if="pageType!='look'&&i===0"
                              style="color:#2a8cec;position: absolute;right: 0px;top:4px;line-height:20px;text-align: center;font-weight: bold;">
                            <!--<span style="font-size:14px; cursor: pointer;position: absolute;color: #fff;width: 94px;border-radius: 5px;right: 0px;padding:0 4px;background:rgb(71, 150, 229);"-->
                            <!--@click="addRow('fangWu','fangWu')" v-if="i==0">增加旧商品房</span>-->
                            <!--<span style="font-size:14px; cursor: pointer;position: absolute;color: #fff;width: 94px;border-radius: 5px;right: 0px;padding:0 4px;background:red;"-->
                            <!--v-else @click="delRow('fangWu',i)">删除旧商品房</span>-->

                            <a class="a-btn"
                               @click="addRow('fangWu','fangWu')">增加旧商品房</a>
                            <a class="a-btn"
                               @click="delRow('fangWu')">删除旧商品房</a>
                        </span>
                    </div>
                    <table class="conTable table-detail" cellspacing="0" cellpadding="0"
                    >
                        <tr>
                            <td class="td-title" style="width: 15%;">房屋类型
                            </td>
                            <td class="td-value" style="width: 35%;">
                                <input type="text" v-if="pageType!='look'"
                                       v-model="item.replacementType"/>
                                <span v-else>{{item.replacementType}}</span>
                            </td>
                            <td class="td-title" style="width: 15%;">房屋名称</td>
                            <td class="td-value" style="width: 35%;">
                                <input type="text" v-if="pageType!='look'"
                                       v-model="item.houseName"/>
                                <span v-else>{{item.houseName}}</span>
                            </td>
                        </tr>
                        <tr>
                            <td class="td-title">房屋位置</td>
                            <td class="td-value">
                                <input type="text" v-if="pageType!='look'"
                                       v-model="item.houseAddress"/>
                                <span v-else>{{item.houseAddress}}</span>
                            </td>
                            <td class="td-title">房屋单元、楼号</td>
                            <td class="td-value">
                                <input type="text" v-if="pageType!='look'"
                                       v-model="item.buildingNumber"/>
                                <span v-else>{{item.buildingNumber}}</span>
                            </td>
                        </tr>
                        <tr>
                            <td class="td-title">房屋面积</td>
                            <td class="td-value"><input type="text" v-if="pageType!='look'"
                                                        v-model="item.area"/>
                                <span v-else>{{item.area}}</span></td>
                            <td class="td-title">房屋年代</td>
                            <td class="td-value"><input type="text" v-if="pageType!='look'"
                                                        v-model="item.factoryDate"
                                                        @focus="showDatePickerYear($event,item)"/>
                                <span v-else>{{item.factoryDate}}</span></td>
                        </tr>
                        <tr>
                            <td class="td-title">产权年限</td>
                            <td class="td-value" colspan="3"><input type="text" v-if="pageType!='look'"
                                                                    v-model="item.housesProperty"/>
                                <span v-else>{{item.housesProperty}}</span></td>

                        </tr>
                        <tr>
                            <td class="td-title">置换价格</td>
                            <td class="td-value" colspan="3">
                                <input v-if="pageType!='look'" type="text"
                                       @blur="strFormat($event.target,'contract.replacement.fangWu.'+i+'.replacementPrice')"
                                       @focus="strFormatF($event.target,'contract.replacement.fangWu.'+i+'.replacementPrice')"
                                       v-onedate="fmoney(item.replacementPrice)"/>
                                <span v-else>{{fmoney(item.replacementPrice)}}</span>
                                <span style="color: red;position:absolute;left:105px;top: 4px;">元</span>
                            </td>
                        </tr>
                    </table>
                </template>
                <template v-if="(contract.replacement.replacementsName).indexOf('other')>=0"
                          v-for="(item,i) in contract.replacement.other">
                    <div>其他置换信息：</div>
                    <table class="conTable table-detail" cellspacing="0" cellpadding="0">
                        <tr>
                            <td class="td-title" style="width: 15%;">商品描述</td>
                            <td class="td-value" colspan="3"><input type="text" v-if="pageType!='look'"
                                                                    v-model="item.otherCondition"
                                                                    @change="changeReplacementsChineseName"/>
                                <span v-else>{{item.otherCondition}}</span></td>

                        </tr>
                        <tr>
                            <td class="td-title">置换价格</td>
                            <td class="td-value" colspan="3">
                                <input v-if="pageType!='look'" type="text"
                                       @blur="strFormat($event.target,'contract.replacement.other.'+i+'.replacementPrice')"
                                       @focus="strFormatF($event.target,'contract.replacement.other.'+i+'.replacementPrice')"
                                       v-onedate="fmoney(item.replacementPrice)"/>
                                <span v-else>{{fmoney(item.replacementPrice)}}</span>
                                <span style="color: red;position:absolute;left:105px;top: 4px;">元</span>
                            </td>
                        </tr>
                    </table>
                </template>
                <div class="conIndent">
                    上述{{contract.replacement.replacementsChineseName}}合计抵顶金额：
                    <span style="display:inline-block;text-indent:0;border-top: none; border-right: none; border-bottom: 1px solid red; border-left: none; border-image: initial; color: red; width: 85px; line-height: 1; text-align: center;">{{fmoney(replacementPrice())}}</span>
                    <span style="color: red"> 元({{number2chinese(replacementPrice())}})</span>，该抵顶金额已包含全部地方政府征收的各种税费，如还需要任何税费均由乙方承担。
                </div>
                <div class="conIndent" style="overflow: hidden;"
                     v-if="!(contract.replacement.replacementsName.indexOf('other')>-1&&contract.replacement.replacementsName=='other')">
                    <div class="pull-left">2、</div>
                    <div class="pull-left" style="text-indent:0">
                        <div v-if="contract.replacement.replacementsChineseName.indexOf('旧设备')>-1||contract.replacement.replacementsChineseName.indexOf('旧汽车')>-1">
                            乙方保证置换{{contract.replacement.replacementsChineseName}}信息真实、设备整体完整（不存在组装、拼装等情况）、没有部件缺失及隐瞒重大故障信息等情况。
                        </div>
                        <div v-if="contract.replacement.replacementsChineseName.indexOf('旧商品房')>-1">
                            乙方保证对所出让旧商品房拥有合法产权，不存在任何产权纠纷。
                        </div>
                    </div>

                </div>
                <div class="conIndent" style="overflow: hidden;">
                    <div class="pull-left">
                        {{(contract.replacement.replacementsName.indexOf('other')>-1&&contract.replacement.replacementsName=='other')?"2":"3"}}、
                    </div>
                    <div class="pull-left" style="text-indent:0">
                        <div v-if="contract.replacement.replacementsChineseName.indexOf('旧设备')>-1||contract.replacement.replacementsChineseName.indexOf('旧汽车')>-1">
                            乙方承诺：向甲方提供上述{{contract.replacement.replacementsChineseName}}所有权的证明材料，包括但不限于发票和合格证原件、原销售合同、结清证明等。
                        </div>
                        <div v-if="contract.replacement.replacementsChineseName.indexOf('旧商品房')>-1">
                            乙方承诺：配合甲方过户，直至将以上旧商品房产权完全转移至甲方公司名下并办理完成《不动产权证书》。
                        </div>
                        <div v-if="contract.replacement.replacementsName.indexOf('other')>-1">
                            乙方承诺：向甲方提供上述{{contract.replacement.other[0].otherCondition}}所有权的证明材料，包括但不限于发票和合格证原件、原销售合同、结清证明等。
                        </div>
                    </div>
                </div>
                <div class="conIndent">
                    {{(contract.replacement.replacementsName.indexOf('other')>-1&&contract.replacement.replacementsName=='other')?"3":"4"}}、乙方承诺：对上述{{contract.replacement.replacementsChineseName}}享有合法的所有权，上述{{contract.replacement.replacementsChineseName}}不存在抵押、质押或其它担保及任何第三方向甲方主张任何权利的情形，如有隐瞒欺诈行为造成的纠纷由乙方承担全部责任，且甲方可随时通过GPS将销售合同(<span
                        style="color:red;" v-if="contract.main.contractNo">{{contract.main.contractNo}}</span>
                    <span v-else style="color: red;">合同创建成功后自动生成</span>)所购买的新设备
                    <span style="color: red">({{contract.main.brandName}}{{contract.main.modelName?contract.main.modelName+",":""}}序列号： {{contract.main.serialNo?contract.main.serialNo:"销售出库后自动带出"}})</span>
                    停机或收回。
                </div>
                <div class="conIndent" v-if="!(pageType=='look'&&(contract.replacement.deficit==0||contract.replacement.deficit==0.00))">
                    {{(contract.replacement.replacementsName.indexOf('other')>-1&&contract.replacement.replacementsName=='other')?"4":"5"}}、合同中新机谈判价格为
                    <span v-if="pageType=='look'" style="display:inline-block;text-indent:0;border-top: none; border-right: none; border-bottom: 1px solid red; border-left: none; border-image: initial; color: red; width: 85px; line-height: 1; text-align: center;">
                        {{fmoney(contract.replacement.nagotiatedPrice)}}</span>
                    <span v-else style="display:inline-block;text-indent:0;border-top: none; border-right: none; border-bottom: 1px solid red; border-left: none; border-image: initial; color: red; width: 85px; line-height: 1; text-align: center;">
                        {{fmoney(contract.sales.unitPrice-(-contract.replacement.deficit))}}</span>

                    <span style="color: red"> 元</span>，因置换亏损
                    <input style="border:none;border-bottom: 1px solid red;color: red;width: 85px;line-height: 1;text-align: center;"
                           v-if="pageType!='look'" type="text"
                           @blur="strFormat($event.target,'contract.replacement.deficit')"
                           @focus="strFormatF($event.target,'contract.replacement.deficit')"
                           v-onedate="fmoney(contract.replacement.deficit)"/>
                    <span v-else
                          style="display:inline-block;text-indent:0;border-top: none; border-right: none; border-bottom: 1px solid red; border-left: none; border-image: initial; color: red; width: 85px; line-height: 1; text-align: center;">
                        {{fmoney(contract.replacement.deficit)}}</span>
                    <span style="color: red"> 元</span>，故合同价为
                    <span style="display:inline-block;text-indent:0;border-top: none; border-right: none; border-bottom: 1px solid red; border-left: none; border-image: initial; color: red; width: 85px; line-height: 1; text-align: center;">
                        {{fmoney(contract.sales.unitPrice)}}</span>
                    <span style="color: red"> 元</span>，整机发票以
                    <span style="display:inline-block;text-indent:0;border-top: none; border-right: none; border-bottom: 1px solid red; border-left: none; border-image: initial; color: red; width: 85px; line-height: 1; text-align: center;">
                        {{fmoney(contract.sales.unitPrice)}}
                    </span>
                    <span style="color: red"> 元</span>开具。
                </div>
                <!--签字2-->
                <div class="sign" style="overflow: hidden">
                    <div class="left">
                        <div class="item" style="margin-bottom: 7px;">
                            <div class="title">甲方（盖章）：</div>
                            <div class="value">{{contract.main.seller}}</div>
                        </div>
                        <div class="item" style="margin-bottom: 7px;">
                            <div class="title">签字：</div>
                        </div>
                        <div class="item" style="margin-bottom: 7px;">
                            <div class="title">日期：</div>
                        </div>
                    </div>
                    <div class="right" style="float: right;">
                        <div class="item" style="margin-bottom: 7px;">
                            <div class="title">乙方（盖章）：</div>
                            <div class="value">{{contract.main.buyer}}</div>
                        </div>
                        <div v-if="buyType!='全款'&&contractType!='2'">
                            <div class="item" style="margin-bottom: 7px;">
                                <div class="title">配偶人签字：</div>
                            </div>
                        </div>
                        <div class="item" style="margin-bottom: 7px;">
                            <div class="title">签字：</div>
                        </div>
                        <div class="item" style="margin-bottom: 7px;">
                            <div class="title">日期：</div>
                        </div>
                        <div v-if="buyType!='全款'&&contractType!='2'">
                            <template v-for="(item,i) in contract.guarantorList">
                                <div class="item" style="margin-bottom: 7px;"
                                     v-if="item.guarantor&&item.guarantor!='无'">
                                    <div class="title">担保方({{getNumber('',i+1)}})（盖章）：</div>
                                    <div class="value">{{item.guarantor}}</div>
                                </div>
                                <div class="item" style="margin-bottom: 7px;"
                                     v-if="item.guarantor&&item.guarantor!='无'">
                                    <div class="title">担保方配偶：</div>
                                </div>
                                <div class="item" style="margin-bottom: 7px;"
                                     v-if="item.guarantor&&item.guarantor!='无'">
                                    <div class="title">签字：</div>
                                </div>
                            </template>
                            <div class="item" style="margin-bottom: 7px ;"
                                 v-if="contract.guarantorList[0].guarantor!='无'&&contract.guarantorList[0].guarantor">
                                <div class="title">日期：</div>
                            </div>
                        </div>
                    </div>
                </div>
            </template>

            <!--担保协议-->
            <template
                    v-if="buyType!='全款'&&buyType!='内部分期'&&contractType!='2'&&(contract.guarantorList[0].guarantor!='无'&&contract.guarantorList[0].guarantor)">
                <div class="conTitle">担保协议</div>
                <table class="conTable table-detail" cellspacing="0" cellpadding="0" style="margin-top: 28px;">
                    <tr>
                        <td class="td-title" style="width: 15%;">卖方</td>
                        <td class="td-value" style="width: 35%;">
                            <span>{{contract.main.seller}}</span>
                        </td>
                        <td class="td-title " style="width: 15%;">
                            买方(公司名称)
                        </td>
                        <td class="td-value" style="width: 35%;">
                            <input v-if="pageType!='look'" type="text" id="buyer"
                                   v-model="contract.main.buyer" v-on:click.stop="inputFocus('buyer')"/>
                            <span v-else>{{contract.main.buyer}}</span>
                        </td>
                    </tr>
                    <tr>
                        <!--<td>税号</td>
                        <td class="td-value">{{contract.main.sellerTaxNo}}</td>-->
                        <td class="td-title" style="position: static;">地址</td>
                        <td class="td-value"><span>{{contract.main.sellerAddress}}</span></td>
                        <td class="td-title">身份证号(公司税号)</td>
                        <td class="td-value">
                            <input type="text" v-if="pageType!='look'"
                                   v-model="contract.main.buyerTaxNo"/>
                            <span v-else>{{contract.main.buyerTaxNo}}</span>
                        </td>
                    </tr>
                    <tr>
                        <td class="td-title">联系电话</td>
                        <td class="td-value">{{contract.main.sellerTel}}</td>
                        <td class="td-title">地址</td>
                        <td class="td-value">
                            <input type="text" v-if="pageType!='look'"
                                   v-model="contract.main.buyerAddress"/>
                            <span v-else>{{contract.main.buyerAddress}}</span>
                        </td>
                    </tr>
                    <tr>
                        <td class="td-title">传真</td>
                        <td class="td-value">{{contract.main.sellerTel}}</td>
                        <td class="td-title">联系电话</td>
                        <td class="td-value">
                            <input type="text" v-if="pageType!='look'"
                                   v-model="contract.main.buyerTel"/>
                            <span v-else>{{contract.main.buyerTel}}</span>
                        </td>
                    </tr>
                </table>
                <template v-if="buyType!='全款'&&contractType!='2'">
                    <div style="height: 28px;position: relative;width: 100%;line-height: 20px;">
                    </div>
                    <table class="conTable table-detail" cellspacing="0" cellpadding="0"
                           v-for="(item,i) in contract.guarantorList">
                        <tr>
                            <td class="td-title twoLine" style="width: 15%;">
                                担保方({{getNumber('',i+1)}})</br>(公司名称)
                            </td>
                            <td class="td-value" style="width: 85%;">
                                <input type="text" v-if="pageType!='look'"
                                       v-model="item.guarantor"/>
                                <span v-else>{{item.guarantor}}</span>
                            </td>
                        </tr>
                        <tr>
                            <td class="td-title twoLine">身份证号(公司税号)</td>
                            <td class="td-value">
                                <input type="text" v-if="pageType!='look'"
                                       v-model="item.guarantorTaxNo"/>
                                <span v-else>{{item.guarantorTaxNo}}</span>
                            </td>
                        </tr>
                        <tr>
                            <td class="td-title">地址</td>
                            <td class="td-value">
                                <input type="text" v-if="pageType!='look'"
                                       v-model="item.guarantorAddress"/>
                                <span v-else>{{item.guarantorAddress}}</span>
                            </td>
                        </tr>
                        <tr>
                            <td class="td-title">联系电话</td>
                            <td class="td-value">
                                <input type="text" v-if="pageType!='look'"
                                       v-model="item.guarantorTel"/>
                                <span v-else>{{item.guarantorTel}}</span>
                            </td>
                        </tr>
                    </table>
                </template>
                <div class="conIndent" style="overflow: hidden">
                    1、鉴于买方向卖方购买挖掘机，双方签署编号(<span
                        style="color:red;" v-if="contract.main.contractNo">{{contract.main.contractNo}}</span>
                    <span v-else style="color: red;">合同创建成功后自动生成</span>)
                    《销售合同》，买方向<span style="color:red;">{{contract.main.financeCompany}}</span>融资，并签署《融资租赁协议》；卖方为买方《融资租赁协议》项下债务向
                    <span style="color:red;">{{contract.main.financeCompany}}</span>提供保证担保。为了保障卖方债权的顺利实现，担保方自愿向为买方向卖方提供担保。现各方达成协议如下：
                </div>
                <div class="conIndent">
                    商品的名称、型号、序列号:
                </div>
                <div class="conIndent">
                    品牌<span style="color: red">{{contract.main.brandName}}</span>，型号<span style="color: red">{{contract.main.modelName}} </span>，序列号<span
                        style="color: red">{{contract.main.serialNo?contract.main.serialNo:"销售出库后自动带出"}}</span>。
                </div>
                <div class="conIndent">
                    2、被担保主债权金额
                </div>
                <div class="conIndent2">
                    2.1 担保方所担保的主债权为卖方与买方签订《销售合同》（合同编号：<span
                        style="color:red;" v-if="contract.main.contractNo">{{contract.main.contractNo}}</span>
                    <span v-else style="color: red;">合同创建成功后自动生成</span>）项下首付款人民币94327元（玖万肆仟叁佰贰拾柒元整）。
                </div>
                <div class="conIndent2">
                    2.2 卖方为买方与<span style="color:red;">{{contract.main.financeCompany}}</span>《融资租赁协议》项下债务承担担保责任后形成的担保债权。
                </div>
                <div class="conIndent">
                    3、保证担保的范围
                </div>
                <div class="conIndent2">
                    3.1担保方保证担保的范围为主债权金额及利息、逾期利息、罚息、复利、违约金、损害赔偿金、卖方为实现债权而发生的费用(包括但不限于诉讼费、仲裁费、保全费、公告费、评估费、鉴定费、拍卖费、差旅费、电讯费、律师费等)以及其他所有主合同债务人的应付费用。
                </div>
                <div class="conIndent">
                    4、在买方未将全部价款交付给卖方、分期款或代垫款全部还清前，本协议项下商品所有权归卖方。
                </div>
                <div class="conIndent">
                    5、保证方式
                </div>
                <div class="conIndent2">
                    5.1担保方的保证方式为连带责任保证。当买方不按主合同的约定履行还款义务时，卖方有权直接向担保方追偿，担保方应立即向卖方清偿。
                </div>
                <div class="conIndent2">
                    5.2若除本合同约定的担保方式外，主合同项下还存在其他担保(包括但不限于主合同债务人向卖方提供物的担保)的，卖方有权选择优先行使本合同项下权利，向担保方提出申请。担保方对卖方承担的保证责任不受任何其他担保的影响，其保证责任的承担也不以卖方向其他任何担保人提出权利主张或进行诉讼/仲裁/强制执行为前提。若卖方因任何原因放弃、变更买方向其提供物的担保、变更担保的顺位，造成其在上述物的担保项下的优先受偿权益丧失或减少，担保方同意其在本合同项下的保证责任并不因之而免除或减少。
                </div>
                <div class="conIndent">
                    6、保证期间
                </div>
                <div class="conIndent2">
                    6.1担保方保证期间为自主合同约定的主债务履行期届满之日起三年。
                </div>
                <div class="conIndent2">
                    6.2前款所述“主债务履行期届满之日”包括买方分期清偿债务的情况下，至最后一笔分期款项到期之日;还包括依主合同约定，主债权人宣布提前到期之日。
                </div>
                <div class="conIndent">
                    7、违约责任
                </div>
                <div class="conIndent2">
                    7.1买方不按时向卖方、按揭融资机构或其他资金出借人付款，担保方须向卖方承担垫付款责任。
                </div>
                <div class="conIndent2">
                    7.2如买方的按揭贷款未获批准，则担保方向卖方承担全部垫付款责任。担保方垫付后可向买方全额追偿；也可以将所售商品处置，同时可向买方追偿损失；
                </div>
                <div class="conIndent2">
                    7.3买方不按时付款，卖方有权采取GPS强制停机、拆卸电脑板等方式对设备予以控制。因此而造成对设备本身、买方、第三方的损失，由买方承担。
                </div>
                <div class="conIndent2">
                    7.4买方自与银行签订贷款合同并放款后三日内向卖方提供银行按揭所需资料，卖方收到买方提供的银行按揭资料后将买方所购设备交付买方。
                </div>
                <div class="conIndent">
                    8、因本合同发生的争议，应友好协商，协商不成，提交卖方所在地人民法院诉讼解决。
                </div>
                <div class="conIndent">
                    9、本协议一式叁份，具有同等法律效力，自三方签字盖章之日起生效。
                </div>
                <!--签字3-->
                <div class="sign" style="overflow: hidden">
                    <div class="left">
                        <div class="item" style="margin-bottom: 7px;">
                            <div class="title">卖方（盖章）：</div>
                            <div class="value">{{contract.main.seller}}</div>
                        </div>
                        <div class="item" style="margin-bottom: 7px;">
                            <div class="title">签字：</div>
                        </div>
                        <div class="item" style="margin-bottom: 7px;">
                            <div class="title">日期：</div>
                        </div>
                    </div>
                    <div class="right" style="float: right;">
                        <div class="item" style="margin-bottom: 7px;">
                            <div class="title">买方（盖章）：</div>
                            <div class="value">{{contract.main.buyer}}</div>
                        </div>
                        <div v-if="buyType!='全款'&&contractType!='2'">
                            <div class="item" style="margin-bottom: 7px;">
                                <div class="title">配偶人签字：</div>
                            </div>
                        </div>
                        <div class="item" style="margin-bottom: 7px;">
                            <div class="title">签字：</div>
                        </div>
                        <div class="item" style="margin-bottom: 7px;">
                            <div class="title">日期：</div>
                        </div>
                        <div v-if="buyType!='全款'&&contractType!='2'">
                            <template v-for="(item,i) in contract.guarantorList">
                                <div class="item" style="margin-bottom: 7px;"
                                     v-if="item.guarantor&&item.guarantor!='无'">
                                    <div class="title">担保方({{getNumber('',i+1)}})（盖章）：</div>
                                    <div class="value">{{item.guarantor}}</div>
                                </div>
                                <div class="item" style="margin-bottom: 7px;"
                                     v-if="item.guarantor&&item.guarantor!='无'">
                                    <div class="title">担保方配偶：</div>
                                </div>
                                <div class="item" style="margin-bottom: 7px;"
                                     v-if="item.guarantor&&item.guarantor!='无'">
                                    <div class="title">签字：</div>
                                </div>
                            </template>
                            <div class="item" style="margin-bottom: 7px ;"
                                 v-if="contract.guarantorList[0].guarantor!='无'&&contract.guarantorList[0].guarantor">
                                <div class="title">日期：</div>
                            </div>
                        </div>
                    </div>
                </div>
            </template>

            <!--质保协议-->
            <template v-if="haveWarranty=='1'">
                <div class="conTitle" style="margin-top:30px ;">质保协议</div>
                <div class="bigTitle">一、买卖双方信息：</div>
                <table class="conTable table-detail" cellspacing="0" cellpadding="0">
                    <tr>
                        <td class="td-title" style="width: 15%;">卖方</td>
                        <td class="td-value" style="width: 35%;">
                            <span>{{contract.main.seller}}</span>
                        </td>
                        <td class="td-title " style="width: 15%;">
                            买方(公司名称)
                        </td>
                        <td class="td-value" style="width: 35%;">
                            <input v-if="pageType!='look'" type="text" id="buyer"
                                   v-model="contract.main.buyer"/>
                            <span v-else>{{contract.main.buyer}}</span>
                        </td>
                    </tr>
                    <tr>
                        <td class="td-title" style="position: static;">地址</td>
                        <td class="td-value"><span>{{contract.main.sellerAddress}}</span></td>
                        <td class="td-title">身份证号(公司税号)</td>
                        <td class="td-value">
                            <input type="text" v-if="pageType!='look'"
                                   v-model="contract.main.buyerTaxNo"/>
                            <span v-else>{{contract.main.buyerTaxNo}}</span>
                        </td>
                    </tr>
                    <tr>
                        <td class="td-title">联系电话</td>
                        <td class="td-value">{{contract.main.sellerTel}}</td>
                        <td class="td-title">地址</td>
                        <td class="td-value">
                            <input type="text" v-if="pageType!='look'"
                                   v-model="contract.main.buyerAddress"/>
                            <span v-else>{{contract.main.buyerAddress}}</span>
                        </td>
                    </tr>
                    <tr>
                        <td class="td-title">传真</td>
                        <td class="td-value">{{contract.main.sellerFax}}</td>
                        <td class="td-title">联系电话</td>
                        <td class="td-value">
                            <input type="text" v-if="pageType!='look'"
                                   v-model="contract.main.buyerTel"/>
                            <span v-else>{{contract.main.buyerTel}}</span>
                        </td>
                    </tr>
                </table>
                <div class="bigTitle">二、设备信息：</div>
                <table class="conTable table-detail" cellspacing="0" cellpadding="0">
                    <tr>
                        <td class="td-title" style="width: 25%;">车型</td>
                        <td class="td-title" style="width: 25%;">序列号</td>
                        <td class="td-title" style="width: 25%;">小时数（H）</td>
                    </tr>
                    <tr>
                        <td class="td-value" style="width: 25%;text-align:center !important;">
                            {{contract.main.modelName}}
                        </td>
                        <td class="td-value" style="width: 25%;text-align:center !important;">
                            {{contract.main.serialNo}}
                        </td>
                        <td class="td-value" style="width: 25%;text-align:center !important;">
                            <input type="text" v-if="pageType!='look'"
                                   v-model="contract.main.hour" style="text-align:center;"/>
                            <span v-else>{{contract.main.hour}}</span>
                        </td>
                    </tr>
                </table>
                <div class="conIndent">经买卖双方协商，订立协议如下：</div>
                <div class="conIndent">
                    一、保修范围：本合同仅就车辆的发动机、主控阀、液压泵、回转马达、行走马达、回转齿轮箱、行走齿轮箱质保（附属件除外），外观部件不做质保，在此期间买方应按照VOLVO新机的操作保养，若未使用VOLVO纯正保养部件，卖方不负责质保，同时质保终止。
                </div>
                <div class="conIndent">二、保修期：质保期为三个月（自车辆交付之日起算）或600小时，先到为止。</div>
                <div class="conIndent">三、争议解决方式：首先由买卖双方进行协商解决，若协商不成，则可向卖方所在地人民法院进行诉讼解决。</div>
                <div class="conIndent">四、本合同一式贰份，双方签字（或盖章）后生效，买卖双方各执壹份。</div>
                <!--签字2-->
                <div class="sign" style="overflow: hidden">
                    <div class="left">
                        <div class="item" style="margin-bottom: 7px;">
                            <div class="title">甲方（盖章）：</div>
                            <div class="value">{{contract.main.seller}}</div>
                        </div>
                        <div class="item" style="margin-bottom: 7px;">
                            <div class="title">签字：</div>
                        </div>
                        <div class="item" style="margin-bottom: 7px;">
                            <div class="title">日期：</div>
                        </div>
                    </div>
                    <div class="right" style="float: right;">
                        <div class="item" style="margin-bottom: 7px;">
                            <div class="title">乙方（盖章）：</div>
                            <div class="value">{{contract.main.buyer}}</div>
                        </div>
                        <div class="item" style="margin-bottom: 7px;">
                            <div class="title">签字：</div>
                        </div>
                        <div class="item" style="margin-bottom: 7px;">
                            <div class="title">日期：</div>
                        </div>
                    </div>
                </div>
            </template>
            <!--审批进度-->
            <table class="table-detail" style="width: 100%;table-layout: auto;margin-top:30px ;" id="auditSchedule">
                <tr>
                    <td class="td-title" colspan="5" style="text-align: center;width: 100%;">审批进度</td>
                </tr>
                <tr>
                    <td class="td-title" style="width:16%;">审核顺序</td>
                    <td class="td-title" style="width:17%;">审核人员</td>
                    <td class="td-title" style="width:16%;">审核状态</td>
                    <td class="td-title" style="width:17%;">审核时间</td>
                    <td class="td-title">审核意见</td>
                </tr>
                <tr v-for="(item,i) in auditors">
                    <td>
                        <span style="font-size:20px;position: absolute;margin-left:-20px;"
                              v-if="pageType!='look'&&i!=auditors.length-1" class="span-btn"
                              @click="addItem(i)"> + </span>
                        <span>第{{i+1}}审核人</span>
                        <span style="font-size:20px;position: absolute;margin-left:10px;"
                              v-if="pageType!='look'&&i!=auditors.length-1" class="span-btn"
                              @click="delItem(i)"> - </span>
                    </td>
                    <td style="text-align: left;">
                        <input v-if="pageType!='look'&&i!=auditors.length-1" class="auditorName" type="text"
                               style="padding-left: 12px !important;"
                               :value="auditName(item.roleName,item.auditorName)" :idx="i" v-autoinput="i"
                               @keyup.delete="deleteAuditor(item)"/>
                        <span v-else style="padding-left: 12px;">{{item.auditorName}}-{{item.roleName}}</span>
                    </td>
                    <td>
                        <span v-if="item.auditFlag==0"
                              style="color:red;">{{convertAuditFlagToName(item.auditFlag)}}</span>
                        <span v-else>{{convertAuditFlagToName(item.auditFlag)}}</span>
                    </td>
                    <td>{{item.auditTime}}</td>
                    <td>{{item.auditAdvise}}</td>
                </tr>
                <tr>
                    <td class="td-title" style="width:16%;">抄送人</td>
                    <td colspan="5" style="text-align: left;padding-left: 6px !important;">
                        <div id="user" style="padding-left:6px;"
                             v-on:click.stop="inputFocus('txtCopier')">
                            <div v-for="(user,i) in copiers" class="user"
                                 v-bind:class="{ select: copierSelectedIdx == i }"
                                 v-on:click="selectUser(i,'copierSelectedIdx')">{{user.copierName}};
                            </div>
                            <input v-if="pageType!='look'" class="pull-left copier" id="txtCopier"
                                   style="width:100px;margin-top: 4px !important;" v-autoinput="1"
                                   type="text" @keyup.delete="deleteUser"/>
                        </div>
                    </td>
                </tr>
            </table>
            <!--审批历史-->
            <table class="table-detail" style="width: 100%;table-layout: auto;" id="auditHistory"
                   v-if="pageType!='add'&&history.length>0" id="auditHistory">
                <tr>
                    <td class="td-title" colspan="5" style="text-align: center;width: 100%;">历史驳回记录</td>
                </tr>
                <tr>
                    <td class="td-title" style="width:16%;">驳回人员</td>
                    <td class="td-title" style="width:17%;">驳回时间</td>
                    <td class="td-title">驳回原因</td>
                </tr>
                <tr v-for="(item,i) in history" v-if="item.auditFlag!=-1">
                    <td>
                        <span>{{item.auditorName}}</span>
                    </td>
                    <td>{{item.auditTime}}</td>
                    <td style="text-align: left;padding-left: 4px !important;">{{item.auditAdvise}}</td>
                </tr>
            </table>
        </div>
        <div class="clearfix"></div>
    </div>
    <div class="div-btn text-center" id="clickInput">
        <template v-if="(pageType=='edit'||pageType=='add')&&(contract.main.auditFlag!=0||contract.main.auditFlag!=1)">
            <input type="button" value="保存草稿" class="btn oaBtn btn-sm" style="margin-top: 5px;" @click="save('caogao')">
            <input type="button" value="提交合同" class="btn oaBtn btn-sm" style="margin-top: 5px;" @click="save('tijiao')">
        </template>
        <template v-else>
            <input type="button" value="通过" class="btn oaBtn btn-sm" style="margin-top: 5px;" @click="audit('tongguo')"
                   v-if="userId==contract.main.currentAuditorId&&contract.main.auditFlag==0">
            <input type="button" value="驳回" class="btn oaBtn btn-sm" style="margin-top: 5px;" @click="audit('bohui')"
                   v-if="userId==contract.main.currentAuditorId&&contract.main.auditFlag==0">
        </template>
        <!--<input type="button" value="超级保存" class="btn oaBtn btn-sm" style="margin-top: 5px;" @click="superSave()"
               v-if="pageType=='look'&&userId=='201711271733404C9DA1461F2421F828'">
        <input type="button" value="wrd保存" class="btn oaBtn btn-sm" style="margin-top: 5px;" @click="saveTe()" >-->
    </div>
</section>

<script src="https://file.ggxqce.com/web/jquery-2.2.3.min.js"></script>
<script src="https://file.ggxqce.com/web/bootstrap.min.js"></script>

<!--框架已定义 JS-->
<script src="/dist/js/app_iframe.js?t=7e54a132"></script>
<!--oa自定义  JS-->
<script src="/dist/js/oa.js?t=558d0414"></script>
<script src="Template.js?t=42e28def"></script>
<script type="text/javascript" src="/dist/plugins/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="/dist/plugins/lhgdialog/lhgdialog.min.js?self=true"></script>

<script>
    var api = frameElement.api;
    if (api) {
        var W = api.opener;
    }
    $(function () {
        $("body").on("click", ".lineOne,.lineTwo", function (e) {
            if ($(".div-td-content-more").is(":hidden")) {
                var text = $(this).text();
                if (text != "") {
                    text = "<i></i>" + text;
                    $(".div-td-content-more").html(text).css({
                        "width": $(this).outerWidth() + 12 + "px",
                        "left": $(this).offset().left - 6,
                        "top": ($(this).offset().top + $(this).outerHeight()) + "px"
                    }).show();
                    e.stopPropagation();
                }
            } else {
                $(".div-td-content-more").hide();
            }
        });
        $("body").on("click", ".div-td-content-more", function (e) {
            e.stopPropagation();
        });
        $("body").on("click", function () {
            $(".div-td-content-more").hide();
        });
    });
</script>
<script>
    $(function () {
        $("body").on("click", ".selectModel", function (e) {
            if ($(".model-picker-dropdown").is(":hidden")) {
                $(".model-picker-dropdown").css({
                    "width": $(this).outerWidth() + "px",
                    "left": $(this).offset().left,
                    "top": ($(this).offset().top + $(this).outerHeight()) + "px"
                }).show();
                e.stopPropagation();
            } else {
                $(".model-picker-dropdown").hide();
            }
        });
        $("body").on("click", ".model-select-tab a", function (e) {
            $(this).parent().find("a").removeClass("active");
            $(this).addClass("active");
            var boxName = $(this).attr("data-count");
            $(".model-select").hide();
            $(".model-select-content" + " ." + boxName).show();
        });
        $("body").on("click", ".model-select  a", function (e) {
            if ($(this).hasClass("active")) {
                return false;
            }
            $(this).parent().find("a").removeClass("active");
            var id = $(this).attr("attr-id");
            $(this).addClass("active");
            var val = $(this).text();
            if ($(this).parents(".model-select").hasClass("type")) {
                $(".model-select-tab a").removeClass("active");
                $(".model-select-tab a[data-count=brand]").addClass("active");
                $(".model-select").hide();
                app.contract.main.province = val;
                app.contract.main.city = '';
                app.getCity(id);
                $(".model-select-content .brand").show();
            } else if ($(this).parents(".model-select").hasClass("brand")) {
                app.contract.main.city = val;
                $(".model-picker-dropdown").hide();
            }
        })
        $("body").on("click", ".model-picker-dropdown", function (e) {
            e.stopPropagation();
        });
        $("body").on("click", function () {
            $(".model-picker-dropdown").hide();
        });
    });

    function refresh() {
        location.reload();
    }
</script>
<script>


    // 注册一个局自定义指令 `v-inputOnce`
    Vue.directive('onedate', {
        // 当被绑定的元素插入到 DOM 中时……
        update: function (el, binding) {
            // 聚焦元素
            if (app.pageType != 'add') {
                if (el.value == "NaN.undefined" || el.value == "") {
                    el.value = binding.value
                }
            }
        },
        componentUpdated: function (el, binding) {
            // 聚焦元素


        }
    })
    //自定义组件
    Vue.component('v-edit-div', {
        props: ['value'],
        data: function () {
            return {
                innerText: this.value,
                isLocked: false
            }
        },
        watch: {
            value: function () {
                if (!this.isLocked && !this.innerText) {
                    this.innerText = this.value;
                }
            }
        },
        methods: {
            changeText: function () {
                this.$emit('input', (this.$el.innerHTML).replace(/<[^>]+>/g, "").replace(/&nbsp;/ig, ""));
            }

        },
        template: '<div class="vEdit"  contenteditable="plaintext-only"   v-html="innerText"   @focus="isLocked = true" @blur="isLocked = false" @input="changeText"></div>'
    });
    // 注册一个局自定义指令 `v-inputOnce`
    Vue.directive('autoinput', {
        // 当被绑定的元素插入到 DOM 中时……
        inserted: function (el, binding) {
            var idx = binding.value;

            $(el).autoComplete({
                url: server.ip + urlConfig.system.user.getTop10ByNameUser,
                render: function (users, panel) {
                    for (var i = 0; i < users.length; i++) {
                        $("<li></li>").data("autoComplete",
                            users[i]).html("<a>" + users[i].name +
                            "(" + users[i].companyName + "-" + users[i].departName + "-" + users[i].roleName + ") " + "</a>")
                            .appendTo(panel);
                    }
                },
                selected: function (user) {
                    console.log($(el))
                    if ($(el).hasClass("auditorName")) {
                        app.auditors[idx].auditorId = user.id;
                        app.auditors[idx].userId = user.id;
                        app.auditors[idx].auditorName = user.name;
                        app.auditors[idx].roleName = user.roleName
                    } else if ($(el).hasClass("copier")) {
                        var userIds = new Array();
                        for (var i = 0; i < app.auditors.length; i++) {
                            userIds.push(app.auditors[i].auditorId ? app.auditors[i].auditorId : app.auditors[i].userId);
                        }
                        for (var i = 0; i < app.copiers.length; i++) {
                            userIds.push(app.copiers[i].copierId ? app.copiers[i].copierId : app.copiers[i].userId);
                        }
                        if ($.inArray(user.id, userIds) == -1) {
                            app.copiers.push({copierId: user.id, copierName: user.name, userId: user.id});
                        } else {
                            alert("审核人、抄送人不能重复输入");
                        }
                        $(el).val("");
                    }
                    return false;
                },
                height: 210,
                width: 300
            });

        }
    })

    var app = new Vue({
        el: '#app',
        data: {
            copierSelectedIdx: -1,
            saveHtml: $.wyui.page.urlParams.saveHtml ? $.wyui.page.urlParams.saveHtml : 0,
            haveWarranty: $.wyui.page.urlParams.haveWarranty ? $.wyui.page.urlParams.haveWarranty : 0,
            id: $.wyui.page.urlParams.id ? $.wyui.page.urlParams.id : '',
            page: $.wyui.page.urlParams.page ? $.wyui.page.urlParams.page : '1',
            pageType: $.wyui.page.urlParams.pageType,//页面类型
            buyType: $.wyui.page.urlParams.buyType,
            zhihuan: $.wyui.page.urlParams.zhihuan,
            diankuan: $.wyui.page.urlParams.diankuan,
            contractType: $.wyui.page.urlParams.contractType,
            companyId: $.wyui.page.urlParams.companyId ? $.wyui.page.urlParams.companyId : '',
            openType: $.wyui.page.urlParams.openType ? $.wyui.page.urlParams.openType : 'top',
            regionManagerName: $.wyui.page.urlParams.regionManagerName ? $.wyui.page.urlParams.regionManagerName : '',
            regionManagerId: $.wyui.page.urlParams.regionManagerId ? $.wyui.page.urlParams.regionManagerId : '',
            repaymentType: $.wyui.page.urlParams.repaymentType ? $.wyui.page.urlParams.repaymentType : '',
            daiShouDaiFu: $.wyui.page.urlParams.daiShouDaiFu ? $.wyui.page.urlParams.daiShouDaiFu : 0,
            userId: $.wyui.page.urlParams.userId ? $.wyui.page.urlParams.userId : getCurrentUser().id,
            gifts: [{title: '', value: ''}, {title: '', value: ''}],
            brandName: "利勃海尔",
            today: "",
            companyBrand: '',
            companyBankId: '',
            brandId: '',
            companyList: [],
            brandOtherList: [],
            companyBrandList: [],
            provinceList: [],
            cityList: [],
            contractTypeList: ['sales'],
            modelMessage: '',
            text: "",
            accessoryGiftHourOther: '',//其他配件赠送（小时数） 的补充说明
            brandList:
                [],
            modelList:
                [],
            contract:
                {
                    main: {city: ""}
                    ,
                    acceptance: {}
                    ,
                    commitment: {}
                    ,
                    confidentiality: {}
                    ,
                    contractTermsList: []
                    ,
                    repaymentList: [],
                    repaymentFQList: [],
                    repayFQFirst: [],
                    replacement:
                        {
                            replacementsName: ['wjj'],
                            replacementsChineseName: '旧设备',
                            description: "",
                            wjj: [
                                new Template.jiuJi('挖掘机')
                            ],
                            zzj: [
                                new Template.jiuJi('装载机')
                            ],
                            qiChe: [
                                new Template.qiChe()
                            ],
                            fangWu: [
                                new Template.fangWu()
                            ],
                            other: [
                                new Template.other()
                            ],
                            deficit:'',
                            finalTotal:'',
                            nagotiatedPrice:'',

                        }
                    ,
                    sales: {}
                    ,
                    supplementary: {},
                    guarantorList:
                        [
                            new Template.guarantorTem()
                        ],
                },
            auditors: [],
            copiers: [],
            history: [],
            companyInfo: {},
            main: {
                city:
                    "",
                repayMent:
                    [
                        new Template.repayMent()
                    ],
                repayFQMent:
                    [],
                repayDKMent:
                    [],
                repayFQFirst:
                    [],
            }
        },

        computed: {
            // 计算属性的 getter
            getSalesTotalPrice: function () {
                // `this` 指向 vm 实例
                return fmoney(Number(this.contract.sales.dealNo) * Number(this.contract.sales.unitPrice));
            },
            getSalesTotal: function () {
                //（单价*数量)+gps+其他+手续费+服务费
                return fmoney(Number(this.contract.sales.dealNo) * Number(this.contract.sales.unitPrice) + Number(this.contract.sales.gpsCharge) + Number(this.contract.sales.otherCharge) + Number(this.contract.sales.serviceCharge) + Number(this.contract.sales.securityCharge) + Number(this.contract.sales.insurancePremium))
            }
        },

        directives: {
            inputMoney: {}
        },
        methods: {
            addItem: function (i) {
                auditUser = {auditorId: '', userId: '', auditorName: '', roleName: ''};
                this.auditors.splice(i + 1, 0, auditUser);
            },
            //融资租赁计算公式
            getRZZL: function (value, type) {
                var that = this;
                var result = '';
                if (type == 'firstPayment') {
                    //首付比例(两位小数)=设备首付金额/单价
                    result = (value / ((Number(this.contract.sales.dealNo) * Number(this.contract.sales.unitPrice)))).toFixed(2);
                    that.contract.sales.downPayment = result;
                    that.contract.sales.loanRation = (1 - result).toFixed(2);
                    that.contract.sales.loanAmount = (Number(this.contract.sales.unitPrice) - Number(value)).toFixed(2);
                    $("#salesLoanAmount").focus();
                    $("#salesFirstPayment").focus();
                }
            },
            delItem: function (i) {
                if (this.auditors.length <= 1) {
                    top.$.alert({
                        win: this,
                        height: 180,
                        width: 300,
                        icon: '3', //1成功 2失败 3提示 不穿代表无图标
                        title: "请至少保留一位审核人！",
                        content: '',
                        blankclose: true,//点击空白是否可关闭
                        ok: "确定"
                    })
                    return
                }
                this.auditors.splice(i, 1);
            },
            deleteUser: function (event) {
                console.log(this.copierSelectedIdx)
                if (event.keyCode == 46 || event.keyCode == 8 && event.target.value == "") {
                    if (this.copierSelectedIdx > -1) {
                        this.contract.copiers.splice(this.copierSelectedIdx, 1);
                        this.copierSelectedIdx = -1;
                    } else {
                        this.copierSelectedIdx = this.contract.copiers.length - 1;
                    }
                }
            },
            selectUser: function (i, prop) {
                this.copierSelectedIdx = i;
                this[prop] = i;
            },
            saveHtmlMethod: function (id) {
                var that = this;
                var html = document.getElementById('app').innerHTML;
                data = {
                    mainId: id,
                    html: html,
                };
                $.wyui.postLoadMethod("/contractMainWyp/saveHtml.json", data, function (now) {

                    $.wyui.postMethod("/contractMainWyp/updateFileOss.json", {contractId: id}, function (data) {
                        alert("提交成功");
                        $(".oaLoad").hide();
                        var pageId = top.getActivePageId();
                        top.refreshTabByName("合同管理", "no", 'page=' + that.page);
                        top.closeTabByPageId("zzht");
                        top.closeTabByPageId(pageId);
                    }, false);
                    /*   setTimeout(function () {

                       }, 500);*/
                }, false, false);
            },
            unselectUser: function () {
                this.copierSelectedIdx = -1;
            },
            deleteAuditor: function (item) {
                item.roleName = '';
                item.auditorName = '';
                item.auditorId = '';
                item.userId = '';
                item.id = '';
            },
            auditName: function (roleName, auditName) {
                if (roleName == "" && auditName == "") {
                    return ""
                } else {
                    return auditName + "-" + roleName;
                }
            },
            inputFocus: function (id) {
                $("#" + id).focus();
            },
            //分期付款 次数
            changePayTimes: function (type) {
                console.log(type)
                if (type == 'repayFQMent') {
                    var addLin = Number(this.contract.sales.payTimes) - Number(this.main.repayFQMent.length);
                    if (addLin > 0) {
                        for (var i = 0; i < addLin; i++) {
                            this.main.repayFQMent.push(new Template['repayMent']());
                        }
                    } else if (addLin < 0) {
                        for (var i = 0; i > addLin; i--) {
                            this.main.repayFQMent.splice(this.main.repayFQMent.length - 1, 1);
                        }
                    }
                }
                if (type == 'repayFQFirst') {
                    var addLin = Number(this.contract.sales.payTimesFqFirst) - Number(this.main.repayFQFirst.length);
                    if (addLin > 0) {
                        for (var i = 0; i < addLin; i++) {
                            this.main.repayFQFirst.push(new Template['repayFQFirst']());
                        }
                    } else if (addLin < 0) {
                        for (var i = 0; i > addLin; i--) {
                            this.main.repayFQFirst.splice(this.main.repayFQFirst.length - 1, 1);
                        }
                    }
                }


            },
            fmoney: function (s, n) {
                n = n > 0 && n <= 20 ? n : 2;
                s = parseFloat((s + "").replace(/[^\d\.-]/g, "")).toFixed(n) + "";
                var l = s.split(".")[0].split("").reverse(), r = s.split(".")[1],
                    t = "";
                for (i = 0; i < l.length; i++) {
                    t += l[i] + ((i + 1) % 3 == 0 && (i + 1) != l.length ? "," : "");
                }
                return t.split("").reverse().join("") + "." + r;
            },
            //置换条款 文字拼接
            showZhiHuanStr: function (strs) {

            },
            strFormat: function (target, data) {
                //此结果为了展示数据
                var value = (target.value).trim();
                value = value.replace(/[^\d{1,}\.\d{1,}|\d{1,}]/g, '');
                if (!value) {
                    value = 0
                }
                ;
                //此结果为data存入数据
                var dataList = data.split('.');

                if (dataList.length > 0) {
                    if (dataList.length == 1) {
                        this[dataList[0]] = value;
                    }
                    if (dataList.length == 2) {
                        this[dataList[0]][dataList[1]] = value;
                    }
                    if (dataList.length == 3) {
                        this[dataList[0]][dataList[1]][dataList[2]] = value;
                    }
                    if (dataList.length == 4) {
                        this[dataList[0]][dataList[1]][dataList[2]][dataList[3]] = value;
                    }
                    if (dataList.length == 5) {
                        this[dataList[0]][dataList[1]][dataList[2]][dataList[3]][dataList[4]] = value;
                    }
                }
                target.value = this.fmoney(value);
            },
            strFormatF: function (target, data) {
                var value = '';
                var dataList = data.split('.');

                if (dataList.length > 0) {
                    if (dataList.length == 1) {
                        value = this[dataList[0]]
                    }
                    if (dataList.length == 2) {
                        value = this[dataList[0]][dataList[1]]
                    }
                    if (dataList.length == 3) {
                        value = this[dataList[0]][dataList[1]][dataList[2]]
                    }
                    if (dataList.length == 4) {
                        value = this[dataList[0]][dataList[1]][dataList[2]][dataList[3]]
                    }
                    if (dataList.length == 5) {
                        value = this[dataList[0]][dataList[1]][dataList[2]][dataList[3]][dataList[4]]
                    }
                }
                if (!value || value == '0.00') {
                    console.log('获取焦点', value)
                    value = '';
                }
                target.value = value;
            },
            replacementPrice: function () {
                var price = 0;
                var that = this;

                if ((that.contract.replacement.replacementsName).indexOf('wjj') >= 0 && that.contract.replacement.wjj.length > 0) {
                    for (var i = 0; i < that.contract.replacement.wjj.length; i++) {
                        if (that.contract.replacement.wjj[i].replacementPrice) {
                            price += Number(that.contract.replacement.wjj[i].replacementPrice)
                        }
                    }
                }
                if ((that.contract.replacement.replacementsName).indexOf('zzj') >= 0 && that.contract.replacement.zzj.length > 0) {
                    for (var i = 0; i < that.contract.replacement.zzj.length; i++) {
                        if (that.contract.replacement.zzj[i].replacementPrice) {
                            price += Number(that.contract.replacement.zzj[i].replacementPrice)
                        }
                    }
                }
                if ((that.contract.replacement.replacementsName).indexOf('qiChe') >= 0 && that.contract.replacement.qiChe.length > 0) {
                    for (var i = 0; i < that.contract.replacement.qiChe.length; i++) {
                        if (that.contract.replacement.qiChe[i].replacementPrice) {
                            price += Number(that.contract.replacement.qiChe[i].replacementPrice)
                        }
                    }
                }
                if ((that.contract.replacement.replacementsName).indexOf('fangWu') >= 0 && that.contract.replacement.fangWu.length > 0) {
                    for (var i = 0; i < that.contract.replacement.fangWu.length; i++) {
                        if (that.contract.replacement.fangWu[i].replacementPrice) {
                            price += Number(that.contract.replacement.fangWu[i].replacementPrice)
                        }
                    }
                }
                if ((that.contract.replacement.replacementsName).indexOf('other') >= 0 && that.contract.replacement.other.length > 0) {
                    for (var i = 0; i < that.contract.replacement.other.length; i++) {
                        if (that.contract.replacement.other[i].replacementPrice) {
                            price += Number(that.contract.replacement.other[i].replacementPrice)
                        }
                    }
                }
                return price;
            },
            convertAuditFlagToName: function (auditFlag) {
                //auditFlag:-1,0,1,2,3,4,5,6
                switch (Number(auditFlag)) {
                    case -1:
                        return "未审核";
                        break;
                    case 0:
                        return "待审核";
                        break;
                    case 1:
                        return "已通过";
                        break;
                    case 2:
                        return "已驳回";
                        break;
                    default :
                        break;
                }
            },
            getToday: function () {
                var that = this;
                $.wyui.postLoadMethod("/system/getCurrentTime.json", {}, function (now) {
                    var d = new Date(now.dateTime);
                    var hour = d.getHours();
                    var minute = d.getMinutes();
                    var second = d.getSeconds();
                    var month = d.getMonth() + 1;
                    var year = d.getFullYear();
                    var day = d.getDate();
                    if (hour < 10) {
                        hour = "0" + hour;
                    }
                    if (minute < 10) {
                        minute = "0" + minute;
                    }
                    if (month < 10) {
                        month = "0" + month;
                    }
                    if (day < 10) {
                        day = "0" + day;
                    }
                    if (year < 10) {
                        year = "0" + year;
                    }
                    that.today = year + "年" + month + "月" + day + "日";
                    return year + "年" + month + "月" + day + "日";
                }, false, false);
            }
            ,
            dayFormat: function (date) {
                var d = new Date(date);
                //return d.Format('yyyy年MM月dd日');
                return d.getFullYear() + '年' + (d.getMonth() + 1) + '月' + d.getDate() + '日'
                /*var dateArray=date.toString().split('-');
                return dateArray[0].startWith() + "年" + dateArray[1] + "月" + dateArray[2] + "日";*/
            },
            showDatePicker: function (e, item, i, completion) {
                var that = this;
                WdatePicker({
                    onpicked: function (dp) {
                        item[i].repaymentDate = dp.cal.getNewDateStr();
                        if (completion == 1) {
                            var stageTerm = that.contract.sales.stageTerm;
                            var payTimes = that.contract.sales.payTimes;
                            if (i == 0 && stageTerm != 0 && payTimes != 0) {
                                var repaymentDateYMD = new Date(item[i].repaymentDate);
                                var newRepaymentDate = new Date(repaymentDateYMD);
                                if (payTimes > 1) {
                                    newRepaymentDate.setDate(repaymentDateYMD.getDate() + 30 * stageTerm / payTimes);
                                    for (var j = 1; j < item.length; j++) {
                                        var newDate = new Date(newRepaymentDate.getFullYear() + '-' + Number(newRepaymentDate.getMonth() + 1) + '-' + newRepaymentDate.getDate());
                                        item[j].repaymentDate = newDate.Format('yyyy-MM-dd');
                                        newRepaymentDate.setDate(newRepaymentDate.getDate() + 30 * stageTerm / payTimes);
                                    }
                                }
                            }
                        }
                        return true;
                    }
                });
                $(e.target).blur();
            }
            ,
            saveTe: function () {
                var that = this;
                $.wyui.postMethod("/contractMainWyp/updateFileOss.json", {contractId: that.id}, function (data) {
                    alert("提交成功");
                    $(".oaLoad").hide();
                    var pageId = top.getActivePageId();
                    top.refreshTabByName("合同管理", "no", 'page=' + that.page);
                    top.closeTabByPageId("zzht");
                    top.closeTabByPageId(pageId);
                }, false);
            },
            //融资情况下计算首付款合计
            getRZ_firstTotalPayment: function () {
                var that = this;
                var firstTotalPayment = that.contract.sales.firstTotalPayment;
                // 凯斯   去掉期末选择购买价格
                // if (that.contract.main.brandId && that.contract.main.brandId == '2018030812524723B474B53E3D65C869') {
                //     that.contract.sales.securityCharge = 0;
                // }
                firstTotalPayment = Number(that.contract.sales.firstPayment) + Number(that.contract.sales.bond) + Number(that.contract.sales.insurancePremium) + Number(that.contract.sales.serviceCharge) + Number(that.contract.sales.gpsCharge) + Number(that.contract.sales.securityCharge);

                return Number(firstTotalPayment);
            },
            showDatePickerYear: function (e, item) {
                WdatePicker({
                    onpicked: function (dp) {
                        item.factoryDate = dp.cal.getNewDateStr();

                        return true;
                    },
                    dateFmt: 'yyyy'
                });
                $(e.target).blur();
            },
            save: function (type) {
                var that = this;

                if (type != 'caogao') {
                    //非草稿时验证必填项
                    /* if (that.contract.main.contractNo == "") {
                         alert("合同编号为必填项");
                         return false;
                     }*/
                    //一.买卖双方及担保方
                    if (that.contract.main.buyer == "") {
                        alert("买卖双方及担保方信息中，请输入买方(公司名称)为必填项");
                        return false;
                    }
                    if (that.contract.main.buyerTaxNo == "") {
                        alert("买卖双方及担保方信息中，买方身份证号(公司税号)为必填项");
                        return false;
                    }
                    if (that.contract.main.buyerAddress == "") {
                        alert("买卖双方及担保方信息中，买方地址为必填项");
                        return false;
                    }
                    if (that.contract.main.buyerTel == "") {
                        alert("买卖双方及担保方信息中，买方联系电话为必填项");
                        return false;
                    }
                    //二,设备及付款信息
                    if (that.contract.main.manufacturer == "") {
                        alert("设备及付款信息中，设备制造商为必选项");
                        return false;
                    }
                    if (that.contract.main.deviceType == "") {
                        alert("设备及付款信息中，设备型号为必选项");
                        return false;
                    }
                    if (that.contract.sales.unitPrice == "") {
                        alert("设备及付款信息中，设备单价为必填项");
                        return false;
                    }
                    if (that.contractType == '1') {
                        if (that.buyType == '内部分期' && that.contract.main.haveFQFirst != 1) {
                            if (that.contract.sales.stageTerm == "") {
                                alert("设备及付款信息中，分期期限为必填项");
                                return false;
                            }
                            if (that.contract.sales.payTimes == "") {
                                alert("设备及付款信息中，分期付款次数为必填项");
                                return false;
                            }
                            for (var i = 0; i < that.main.repayFQMent.length; i++) {
                                if (that.main.repayFQMent[i].repaymentDate == '') {
                                    alert("设备及付款信息中，还款日期为必填项");
                                    return false;
                                }
                            }
                        }
                        if (that.buyType == '内部分期' && that.contract.main.haveFQFirst == 1) {
                            if (that.contract.sales.stageTermFqFirst == "") {
                                alert("首付款分期中，分期期限为必填项");
                                return false;
                            }
                            if (that.contract.sales.payTimesFqFirst == "") {
                                alert("首付款分期中，分期付款次数为必填项");
                                return false;
                            }
                            for (var i = 0; i < that.main.repayFQFirst.length; i++) {
                                if (that.main.repayFQFirst[i].repaymentDate == '') {
                                    alert("首付款分期中，还款日期为必填项");
                                    return false;
                                }
                            }
                        }
                        if (that.buyType == '融资租赁') {
                            if (that.contract.main.financeCompany == "") {
                                alert("设备及付款信息中，融资公司为必填项");
                                return false;
                            }
                            if (that.contract.sales.downPayment == "") {
                                alert("设备及付款信息中，首付比例为必填项");
                                return false;
                            }
                            if (that.contract.sales.firstPayment == "") {
                                alert("设备及付款信息中，设备首付金额为必填项");
                                return false;
                            }
                            if (that.contract.sales.loanRation == "") {
                                alert("设备及付款信息中，融资比例为必填项");
                                return false;
                            }
                            if (that.contract.sales.loanAmount == "") {
                                alert("设备及付款信息中，融资金额为必填项");
                                return false;
                            }
                            if (that.contract.sales.loanRation == "") {
                                alert("设备及付款信息中，融资期限为必填项");
                                return false;
                            }
                            if (that.contract.sales.bond == "") {
                                alert("设备及付款信息中，保证金为必填项");
                                return false;
                            }
                            if (that.daiShouDaiFu == '1' & that.contract.main.bankName == "") {
                                alert("代收代付协议中，开户行为必填项");
                                return false;
                            }

                        }
                        //融资租赁打包
                        if (that.buyType == '融资租赁打包') {
                            if (that.contract.main.financeCompany == "") {
                                alert("设备及付款信息中，融资公司为必填项");
                                return false;
                            }
                            if (that.contract.sales.firstPayment == "") {
                                alert("设备及付款信息中，设备首付金额为必填项");
                                return false;
                            }
                            if (that.contract.sales.loanTerm == "") {
                                alert("设备及付款信息中，融资期限为必填项");
                                return false;
                            }
                            if (that.contract.sales.loanAmount == "") {
                                alert("设备及付款信息中，融资金额为必填项");
                                return false;
                            }
//                            if (that.contract.sales.monthlyRepayment == "") {
//                                var repaymentType = "repaymentType=='季度还款'" ? '季度还款' : '月还款'
//                                alert("设备及付款信息中，" + repaymentType + "为必填项");
//                                return false;
//                            }
                            if (that.daiShouDaiFu == '1' & that.contract.main.bankName == "") {
                                alert("代收代付协议中，开户行为必填项");
                                return false;
                            }

                        }
                        //三,以旧换新条款
                        if (that.zhihuan == '1') {
                            if (that.contract.replacement.replacementsName.length < 1) {
                                alert("以旧换新条款中，请至少选择一项商品类型");
                                return false;
                            }

                        }
                        //三,垫款条款
                        if (that.diankuan == '1') {
                            if (that.contract.main.dkFirstMoney == "") {
                                alert("垫款条款中，垫付首付款为必填项");
                                return false;
                            }
                            for (var i = 0; i < that.main.repayDKMent.length; i++) {
                                if (that.main.repayDKMent[i].repaymentDate == '') {
                                    alert("垫款条款中，还款日期为必填项");
                                    return false;
                                }
                            }
                        }
                    }
                }
                if (type == 'tijiao') {
                    that.contract.main.auditFlag = 0;
                }
                if (type == 'caogao') {
                    that.contract.main.auditFlag = -1;
                }
                var re = /^[0-9]+.?[0-9]*$/;
                if (re.test(that.contract.sales.accessoryGift)) {
                    that.contract.sales.accessoryGift = that.contract.sales.accessoryGift + '元（' + that.number2chinese(that.contract.sales.accessoryGift) + '）' + '常规保养件';
                }
                that.contract.sales.accessoryGiftHour = (that.contract.sales.accessoryGiftHour == '' ? 0 : that.contract.sales.accessoryGiftHour) + '小时内保养件' + that.accessoryGiftHourOther;
                if (re.test(that.contract.sales.exhibitionGift)) {
                    that.contract.sales.exhibitionGift = that.contract.sales.exhibitionGift + '元（' + that.number2chinese(that.contract.sales.exhibitionGift) + '）' + '常规保养件';
                }
                //that.contract.main.province = that.companyInfo.province;
                that.contract.main.updateUserId = that.userId;
                //that.contract.main.city = that.companyInfo.city;
                that.contract.main.createUserId = that.userId;
                that.contract.main.buyType = that.buyType;
                that.contract.main.haveDsdf = that.daiShouDaiFu;
                that.contract.main.haveWarranty = that.haveWarranty;
                that.contract.main.contractType = that.contractType;
                that.contract.main.regionManagerName = that.regionManagerName;
                that.contract.main.regionManagerId = that.regionManagerId;
                that.contract.main.haveRepayment = that.diankuan;
                that.contract.main.haveReplacement = that.zhihuan;
                that.contract.main.repaymentType = that.repaymentType;
                /*   if (that.contractType == '1') {
                       that.contract.main.authenticbrandsGroup = that.modelMessage.authenticbrandsGroup;
                       that.contract.main.qualityCompany = that.modelMessage.qualityCompany;
                       that.contract.main.manufacturer = that.modelMessage.manufacturer;
                       that.contract.main.financeCompany = that.modelMessage.financeCompany;
                   }*/
                //将本地计算的合计数据传入
//                    that.contract.sales.total = that.getSalesTotal.replaceAll(',', '');//设备及付款信息中的合计
                if (that.diankuan == 1) {
                    //垫款 本息合计
                    that.contract.main.dkSumTotal = Number(that.total('principal', that.main.repayDKMent)) + Number(that.total('interest', that.main.repayDKMent))
                    that.contract.main.dkSumPrincipal = that.total('principal', that.main.repayDKMent);//垫款本金的合计
                    that.contract.main.dkSumInterest = that.total('interest', that.main.repayDKMent);//垫款利息的合计

                    that.contract.main.dkFirstMoneydx = that.number2chinese(that.contract.main.dkFirstMoney);
                }
                if (that.buyType == '内部分期' && that.contract.main.haveFQFirst != 1) {
                    //分期付款 本息合计
                    that.contract.main.fqSumTotal = Number(that.total('principal', that.main.repayFQMent)) + Number(that.total('interest', that.main.repayFQMent))
                    that.contract.main.fqSumPrincipal = that.total('principal', that.main.repayFQMent);//分期本金的合计
                    that.contract.main.fqSumInterest = that.total('interest', that.main.repayFQMent);//分期利息的合计
                    that.contract.main.fqFirstMoneydx = that.number2chinese(that.contract.main.fqFirstMoney);
                }
                if (that.buyType == '内部分期' && that.contract.main.haveFQFirst == 1) {
                    //分期付款 本息合计
                    that.contract.main.fqFirstMoneydx = that.number2chinese(that.contract.main.fqFirstMoney);
                    that.contract.main.fqSumTotal = Number(that.total('principal', that.main.repayFQMent)) + Number(that.total('interest', that.main.repayFQMent))
                    that.contract.main.fqSumPrincipal = that.total('principal', that.main.repayFQMent);//分期本金的合计
                    that.contract.main.fqSumInterest = that.total('interest', that.main.repayFQMent);//分期利息的合计
                    that.contract.main.fqFirsetSumPrincipal = Number(that.total('principal', that.main.repayFQFirst));
                }
                if (that.buyType == '融资租赁') {
                    that.contract.sales.total = Number(that.contract.sales.firstPayment) + Number(that.contract.sales.bond) + Number(that.contract.sales.insurancePremium) + Number(that.contract.sales.serviceCharge) + Number(that.contract.sales.gpsCharge) + Number(that.contract.sales.securityCharge) + Number(that.contract.sales.loanAmount);
                }
                if (that.buyType == '融资租赁打包') {
                    that.contract.sales.rzdbTotalPricedx = that.number2chinese(that.contract.sales.total);
                }
                // 融资情况下计算首付款合计
                if (that.buyType == '融资租赁打包' || that.buyType == '融资租赁') {
                    that.contract.sales.firstTotalPayment = that.getRZ_firstTotalPayment();
                }
                if (that.zhihuan == 1) {
                    that.contract.replacement.total = that.replacementPrice();//
                    that.contract.replacement.totaldx = that.number2chinese(that.replacementPrice());
//                    that.contract.replacement.finalTotal = that.contract.sales.unitPrice-that.contract.replacement.deficit;
                    that.contract.replacement.nagotiatedPrice = that.contract.sales.unitPrice-(-that.contract.replacement.deficit);
                }
                //不含税金额	与 增值税税额（13%）	计算
                that.contract.sales.noTaxAmount = that.contract.sales.unitPrice / 1.13;
                that.contract.sales.taxAmount = that.contract.sales.unitPrice - (that.contract.sales.unitPrice / 1.13);
                if (that.contract.auditors) {
                    var auditors = [];
                    for (var i = 0; i < that.contract.auditors.length; i++) {
                        if (that.contract.auditors[i].userId == '' && that.contract.auditors[i].auditorId == '') {

                        } else {
                            auditors.push(that.contract.auditors[i]);
                        }
                    }
                    that.contract.auditors = auditors;
                }
                $(".oaLoad").show();
                $.wyui.postLoadMethod(urlConfig.contractWyp.save, trimRN(that.contract), function (data) {
                    var id = data.id;
                    if (type == 'caogao') {
                        alert("保存草稿成功")
                        $(".oaLoad").hide();
                        setTimeout(function () {  //使用  setTimeout（）方法设定定时2000毫秒
                            var pageId = top.getActivePageId();
                            top.refreshTabByName("合同管理", "no", 'page=' + that.page);
                            top.closeTabByPageId("zzht");
                            top.closeTabByPageId(pageId);
                        }, 500);
                    } else {
                        $("#ifSave").attr("src", "/page/apply/contractWyp/detail_new.html?id=" + id + "&buyType=" + that.buyType + "&zhihuan=" + that.zhihuan + "&diankuan=" + that.diankuan
                            + "&regionManagerId=" + that.regionManagerId + "&regionManagerName=" + that.regionManagerName + "&contractType=" +
                            that.contractType + "&companyId=" + that.companyId + "&pageType=look&saveHtml=1&haveWarranty=" + that.haveWarranty);
                    }

                }, false, false);
            },
            superSave: function () {
                var that = this;
                that.saveHtmlMethod(that.id);
            },
            copierReturn: function () {
                var that = this;
                $.dialog({
                    content: 'url:/page/apply/contractWyp/copierReturnReason.html?id=' + that.id + "&pageType=1&openType=" + that.openType + "&t=" + new Date(),
                    title: '填写驳回原因',
                    width: 300,
                    height: 200,
                    max: false,
                    min: false,
                    lock: true
                });
            },
            audit: function (type) {
                var that = this;
                if (type == 'tongguo') {
                    if (!confirm("确定要通过吗？")) {
                        return;
                    }
                    advise = '同意！';
                    $.wyui.postLoadMethod(urlConfig.contractWyp.applyAudit, {
                            id: that.id,
                            auditFlag: 1,
                            advise: '同意!',
                            userId: that.userId
                        },
                        function (r) {
                            if (that.openType == 'top') {
                                var pageId = top.getActivePageId();
                                console.log("+++++" + that.page);
                                top.refreshTabByName("合同管理", "no", 'page=' + that.page);
                                top.closeTabByPageId("zzht");
                                top.closeTabByPageId(pageId);
                            } else {
                                // parent.refresh();
                                refresh();
                                //api.close();
                            }
                        }, false, true);
                } else {
                    that.copierReturn();
                    //alert('请填写审核意见');
                    /*if (that.openType == 'dialog') {
                        api.close();
                    }*/
                    return;
                }
            },
            number2chinese: function (str) {
                var num = parseInt(str);
                var strOutput = "",
                    strUnit = '仟佰拾亿仟佰拾万仟佰拾元角分';
                num += "00";
                var intPos = num.indexOf('.');
                if (intPos >= 0) {
                    num = num.substring(0, intPos) + num.substr(intPos + 1, 2);
                }
                strUnit = strUnit.substr(strUnit.length - num.length);
                for (var i = 0; i < num.length; i++) {
                    strOutput += '零壹贰叁肆伍陆柒捌玖'.substr(num.substr(i, 1), 1) + strUnit.substr(i, 1);
                }
                return strOutput.replace(/零角零分$/, '整').replace(/零[仟佰拾]/g, '零').replace(/零{2,}/g, '零').replace(/零([亿|万])/g, '$1').replace(/零+元/, '元').replace(/亿零{0,3}万/, '亿').replace(/^元/, "零元")
            },
            number2big: function (number) {
                switch (Number(number)) {
                    case 1:
                        return '一';
                        break;
                    case 2:
                        return '二';
                        break;
                    case 3:
                        return '三';
                        break;
                    case 4:
                        return '四';
                        break;
                    case 5:
                        return '五';
                        break;
                    case 6:
                        return '六';
                        break;
                    case 7:
                        return '七';
                        break;
                    case 8:
                        return '八';
                        break;
                    case 9:
                        return '九';
                        break;
                    case 10:
                        return '十';
                        break;
                }
            },
            getNumber: function (str, number) {
                var that = this;
                if (str == "条款") {
                    if (that.buyType == '全款') {
                        if (that.diankuan === "1") {
                            number = Number(number) + 1;
                        } else {
                            number = Number(number);
                        }
                    } else if (that.buyType == "内部分期") {
                        if (that.diankuan === "1") {
                            number = Number(number) + 2;
                        } else {
                            number = Number(number) + 1;
                        }
                    } else if (that.buyType == "融资租赁") {
                        if (that.diankuan === "1") {
                            number = Number(number) + 2;
                        } else {
                            number = Number(number) + 1;
                        }
                    } else if (that.buyType == "融资租赁打包") {
                        if (that.diankuan === "1") {
                            number = Number(number) + 2;
                        } else {
                            number = Number(number) + 1;
                        }
                    }
                }
                return that.number2big(number);
            },
            checkedOne: function (moduleKey) {
                var idIndex = (this.contract.replacement.replacementsName).indexOf(moduleKey);
                if (idIndex >= 0 && this.contract.replacement.replacementsName.length == 1) {
                    alert("请至少选择一项置换类型");
                    return false;
                }
                if (idIndex >= 0) {
                    // 如果已经包含了该id, 则去除(单选按钮由选中变为非选中状态)

                    (this.contract.replacement.replacementsName).splice(idIndex, 1)
                } else {
                    // 选中该checkbox
                    (this.contract.replacement.replacementsName).push(moduleKey)
                }
                this.changeReplacementsChineseName()
            },
            checkedFirstMoneyFQ: function (type) {
                var that = this;
                if (type == 'FQFirstMoney') {
                    if (that.contract.main.haveFQFirst == 1) {
                        that.contract.main.haveFQFirst = 0;
                    } else {
                        that.contract.main.haveFQFirst = 1;
                    }
                }
            },
            changeReplacementsChineseName: function () {
                var newList = [];
                if (this.contract.replacement.replacementsName.length > 0) {
                    for (var i = 0; i < this.contract.replacement.replacementsName.length; i++) {
                        var data = this.contract.replacement.replacementsName[i];
                        if ((data == 'wjj' || data == 'zzj') && newList.indexOf('旧设备') < 0) {
                            newList.push('旧设备')
                        }
                        if (data == 'qiChe') {
                            newList.push('旧汽车')
                        }
                        if (data == 'fangWu') {
                            newList.push('旧商品房')
                        }
                        if (data == 'other' && this.contract.replacement.other[0].otherCondition) {
                            newList.push(this.contract.replacement.other[0].otherCondition)
                        }
                    }
                }
                this.contract.replacement.replacementsChineseName = newList.join("/");
                console.log(this.contract.replacement.replacementsChineseName)
            },
            changeCompany: function () {
                var that = this;
                $.wyui.postLoadMethod("/company/getCompanyById.json", {
                    id: that.companyId
                }, function (data) {
                    var data = data.company;
                    that.companyInfo = data;
                    that.contract.main.sellerTel = data.fixedTelephone;
                    that.contract.main.sellerAddress = data.address;
                    that.contract.main.sellerTaxNo = data.taxId;
                    that.contract.main.seller = data.allName;
                    that.contract.main.sellerCompanyId = data.id;
                    that.contract.main.sellerFax = data.fax;
                }, false, false);
            }
            ,
            getCity: function (id) {
                var that = this;
                $.wyui.postLoadMethod('/intentCustomer/getForProvinceById.json', {'id': id}, function (r) {
                    that.cityList = r.records;
                }, false, false);
            }
            ,
            total: function (theWay, item) {
                if (item) {
                    var total = Number(0);
                    var principal = Number(0);
                    var interest = Number(0);
                    if (theWay == 'total') {
                        for (var i = 0; i < item.length; i++) {
                            principal = principal + Number(item[i].principal);
                        }
                        for (var i = 0; i < item.length; i++) {
                            interest = interest + Number(item[i].interest);
                        }
                        return Number(principal) + Number(interest);
                    } else if (theWay == 'principal') {
                        for (var i = 0; i < item.length; i++) {
                            principal = principal + Number(item[i].principal);
                        }
                        return principal;
                    } else if (theWay == 'interest') {
                        for (var i = 0; i < item.length; i++) {
                            interest = interest + Number(item[i].interest);
                        }
                        return interest;
                    }
                }
            }
            ,
            addRow: function (prop, template, str) {
                if (prop == 'guarantorList') {
                    this.contract[prop].push(new Template[template]());
                } else if (prop == 'jiuJi' || prop == 'qiChe' || prop == 'fangWu' || prop == 'wjj' || prop == 'zzj' || prop == 'psc' || prop == 'sfj') {
                    this.contract.replacement[prop].push(new Template[template](str));
                } else if (prop == 'repayFQFirst') {
                    this.main[prop].push(new Template[template]());
                } else {
                    this.main[prop].push(new Template[template]());
                }
                if (prop == 'repayFQMent') {
                    this.contract.sales.payTimes = this.main.repayFQMent.length
                }
                if (prop == 'repayFQFirst') {
                    this.contract.sales.payTimesFqFirst = this.main.repayFQFirst.length
                }
            },
            delRow: function (prop) {
                if (prop == 'guarantorList') {
                    if (this.contract[prop].length <= 1) {
                        return false;
                    }
                    this.contract[prop].splice(this.contract[prop].length - 1, 1);
                } else if (prop == 'jiuJi' || prop == 'qiChe' || prop == 'fangWu' || prop == 'wjj' || prop == 'zzj' || prop == 'psc' || prop == 'sfj') {
                    if (this.contract.replacement[prop].length <= 1) {
                        return false;
                    }
                    this.contract.replacement[prop].splice(this.contract.replacement[prop].length - 1, 1);
                } else if (prop == 'repayFQFirst') {
                    if (this.main[prop].length <= 1) {
                        return false;
                    }
                    this.main[prop].splice(this.main[prop].length - 1, 1);
                } else {
                    if (this.main[prop].length <= 1) {
                        return false;
                    }
                    this.main[prop].splice(this.main[prop].length - 1, 1);
                }
                if (prop == 'repayFQMent') {
                    this.contract.sales.payTimes = this.main.repayFQMent.length
                }
                if (prop == 'repayFQFirst') {
                    this.contract.sales.payTimesFqFirst = this.main.repayFQFirst.length
                }
            }
            ,
            changeBrand: function (modelId) {
                var that = this;
                $.wyui.postLoadMethod("/deviceModel/getModelListByBId.json", {
                    brandId: that.contract.main.brandId
                }, function (data) {
                    that.modelList = data.models;
                    /* if (that.modelList.length > 0) {
                         that.contract.main.manufacturer = data.models[0].manufacturer;
                     }*/
                    console.log(modelId)
                    //编辑状态 需要通过modelId拿到对应的型号对象
                    if (modelId) {
                        that.getModelMessage(modelId)
                    }
                }, false, false);
                $.wyui.postLoadMethod("/deviceCompanyBrand/getByCompanyIdAndBrandId.json", {
                    companyId: that.contract.main.sellerCompanyId,
                    brandId: that.contract.main.brandId
                }, function (data) {
                    that.brandOtherList = data.records;
                }, false, false);
            },
            changeModel: function () {
                var that = this;
                console.log(that.modelMessage)
                that.contract.main.deviceType = that.modelMessage.deviceType;
                that.contract.main.brandName = that.modelMessage.brandName;
                that.contract.main.modelId = that.modelMessage.modelId;
                that.contract.main.modelName = that.modelMessage.modelName;
                /*that.contract.main.financeCompany = that.modelMessage.financeCompany;
                that.contract.main.qualityCompany = that.modelMessage.qualityCompany;
                that.contract.main.authenticbrandsGroup = that.modelMessage.authenticbrandsGroup;*/
            },
            getModelMessage: function (modelId) {
                for (var i = 0; i < this.modelList.length; i++) {
                    if (this.modelList[i].modelId == modelId) {
                        this.modelMessage = this.modelList[i]
                    }
                }
            },
            changeCompanyBankCard: function (id) {
                var that = this;
                if (id != '') {
                    $.wyui.postLoadMethod(urlConfig.system.company.getBanksByCompanyId2BankId, {"id": id}, function (r) {
                        that.contract.main.bankName = r.bankName;
                        that.contract.main.bankCard = r.bankCard;
                    }, false, false);
                }
            },
        },
        mounted: function () {
            var that = this;
            var flag = false;
            var saveHtml = $.wyui.page.urlParams.saveHtml;
            if (that.pageType == "add") {
                flag = true;
                $.wyui.postLoadMethod(urlConfig.contractWyp.newContract, {
                    userId: that.userId,
                    regionManagerId: that.regionManagerId,
                    contractType: that.contractType,
                    buyType: that.buyType,
                }, function (data) {
                    var replacement = that.contract.replacement;
                    that.contract = data;
                    if (that.companyId == '201804031651473CA771C95F5B8A0ACF') {
                        //山西沃源
                        that.contract.main.city = '太原';
                    } else if (that.companyId == '2018041104174574AC1D4939178B2D27') {
                        //内蒙辽鞍
                        that.contract.main.city = '呼和浩特金川开发区';
                    }
                    that.contract.replacement = replacement;
                    /*  2019-04-11
                     曹国玉: 融资合同的第一审核人加上本省的信控岗位人员审核
                     曹国玉: 融资和融资租赁打包的
                     曹国玉:  都加上
                     曹国玉: 全款和内部分期的不用，按原来的来*/
                    var auditors = data.auditors;
                    if (auditors && auditors.length > 0) {
                        if (that.buyType != '融资租赁' && that.buyType != '融资租赁打包') {
                            if (auditors[0].roleName == '信控专员') {
                                auditors.splice(0, 1);
                            }
                        }
                    }
                    that.auditors = auditors;
                    that.copiers = data.copiers;
                    that.history = data.history;
                    that.main.repayFQMent = data.repaymentFQList;
                    that.main.repayDKMent = data.repaymentDKList;
                    that.main.repayFQFirst = data.repaymentFQFirstList;
                    var contractTermsList = data.contractTermsList;
                    that.main.contractTermsList = contractTermsList;
                    that.changeCompany();
                }, false, true);
            } else if (that.pageType == 'edit') {
                flag = true;
                $.wyui.postLoadMethod(urlConfig.contractWyp.selectContractById, {id: that.id}, function (data) {
                    that.contract = data;
                    that.auditors = data.auditors;
                    that.copiers = data.copiers;
                    if (that.companyId == '201804031651473CA771C95F5B8A0ACF') {
                        //山西沃源
                        that.contract.main.city = '太原';
                    } else if (that.companyId == '2018041104174574AC1D4939178B2D27') {
                        //内蒙辽鞍
                        that.contract.main.city = '呼和浩特金川开发区';
                    }
                    var re = /^[0-9]+.?[0-9]*$/;
                    var index = that.contract.sales.accessoryGift.indexOf('元');
                    index = index == -1 ? 0 : index;
                    // 其他配件赠送 （按金额）
                    var accessoryGift = that.contract.sales.accessoryGift.substring(0, index);
                    if (re.test(accessoryGift)) {
                        that.contract.sales.accessoryGift = accessoryGift;
                    } else {
                        that.contract.sales.accessoryGift = 0;
                    }
                    //其他配件赠送 （小时数）
                    var accessoryGiftHour = that.contract.sales.accessoryGiftHour;
                    index = accessoryGiftHour.indexOf('小时内保养件');
                    index = index == -1 ? 0 : index;
                    that.contract.sales.accessoryGiftHour = accessoryGiftHour.substring(0, index);
                    if (!re.test(that.contract.sales.accessoryGiftHour)) {
                        that.contract.sales.accessoryGiftHour = 0;
                        that.accessoryGiftHourOther = '';
                    } else {
                        that.accessoryGiftHourOther = accessoryGiftHour.substring(index + 6, accessoryGiftHour.length);
                    }

                    //展会配件赠送
                    index = that.contract.sales.exhibitionGift.indexOf('元');
                    index = index == -1 ? 0 : index;
                    that.contract.sales.exhibitionGift = that.contract.sales.exhibitionGift.substring(0, index);
                    if (!re.test(that.contract.sales.exhibitionGift)) {
                        that.contract.sales.exhibitionGift = 0;
                    }
                    that.history = data.history;
                    //that.companyInfo = {city: data.main.city, province: data.main.province};
                    //编辑时需要拿到型号列表已经选中的型号
                    that.changeBrand(data.main.modelId);
                    that.contract.replacement.replacementsName = that.contract.replacement.replacementsName.split(",")
                    that.main.repayFQMent = data.repaymentFQList;
                    that.main.repayDKMent = data.repaymentDKList;
                    that.main.repayFQFirst = data.repaymentFQFirstList;
                    that.main.contractTermsList = data.contractTermsList;
                    that.daiShouDaiFu = data.main.haveDsdf;
                    that.buyType = data.main.buyType;
                    that.repaymentType = data.main.repaymentType;
                }, false, true);
            } else {

                //查看
                $.wyui.postLoadMethod(urlConfig.contractWyp.selectContractById, {id: that.id}, function (data) {
                    that.contract = data;

                    var re = /^[0-9]+.?[0-9]*$/;
                    var index = that.contract.sales.accessoryGift.indexOf('元');
                    index = index == -1 ? 0 : index;
                    var accessoryGift = that.contract.sales.accessoryGift.substring(0, index);
                    if (re.test(accessoryGift)) {
                        if (Number(0) == accessoryGift) {
                            that.contract.sales.accessoryGift = '';
                        }
                    }

                    index = that.contract.sales.accessoryGiftHour.indexOf('小时内保养件');
                    index = index == -1 ? 0 : index;
                    var accessoryGiftHour = that.contract.sales.accessoryGiftHour.substring(0, index);
                    if (re.test(accessoryGiftHour)) {
                        if (Number(0) == accessoryGiftHour) {
                            that.contract.sales.accessoryGiftHour = '';
                        }
                    }

                    index = that.contract.sales.exhibitionGift.indexOf('元');
                    index = index == -1 ? 0 : index;
                    var exhibitionGift = that.contract.sales.exhibitionGift.substring(0, index);
                    if (re.test(exhibitionGift)) {
                        if (Number(0) == exhibitionGift) {
                            that.contract.sales.exhibitionGift = '';
                        }
                    }

                    that.auditors = data.auditors;
                    that.copiers = data.copiers;
                    that.history = data.history;
                    //that.companyInfo = {city: data.main.city, province: data.main.province};
                    that.main.repayFQMent = data.repaymentFQList;
                    that.main.repayDKMent = data.repaymentDKList;
                    that.main.repayFQFirst = data.repaymentFQFirstList;
                    that.main.contractTermsList = data.contractTermsList;
                    that.daiShouDaiFu = data.main.haveDsdf;
                    that.buyType = data.main.buyType;
                    that.repaymentType = data.main.repaymentType;
                    setTimeout(function () {
                        if (saveHtml && saveHtml == 1) {
                            that.saveHtmlMethod(that.id);
                        }
                    }, 500);


                }, false, true);
            }
            //edit和add才调用
            if (flag) {
                that.getToday();


                $.wyui.postLoadMethod("/deviceModel/getBrandByCompanyId.json", {companyId: that.companyId}, function (data) {
                    that.brandList = data.brands;
                }, false, false);
                $.wyui.postLoadMethod(urlConfig.system.company.getBanksByCompanyId, {companyId: that.companyId}, function (r) {
                    that.companyBrandList = r;
                }, false, false);
            }
        }
    });

</script>
<script>
    $('[contenteditable]').each(function () {
        // 干掉IE http之类地址自动加链接
        try {
            document.execCommand("AutoUrlDetect", false, false);
        } catch (e) {
        }

        $(this).on('paste', function (e) {
            e.preventDefault();
            var text = null;

            if (window.clipboardData && clipboardData.setData) {
                // IE
                text = window.clipboardData.getData('text');
            } else {
                text = (e.originalEvent || e).clipboardData.getData('text/plain') || prompt('在这里输入文本');
            }
            if (document.body.createTextRange) {
                if (document.selection) {
                    textRange = document.selection.createRange();
                } else if (window.getSelection) {
                    sel = window.getSelection();
                    var range = sel.getRangeAt(0);

                    // 创建临时元素，使得TextRange可以移动到正确的位置
                    var tempEl = document.createElement("span");
                    tempEl.innerHTML = "&#FEFF;";
                    range.deleteContents();
                    range.insertNode(tempEl);
                    textRange = document.body.createTextRange();
                    textRange.moveToElementText(tempEl);
                    tempEl.parentNode.removeChild(tempEl);
                }
                textRange.text = text;
                textRange.collapse(false);
                textRange.select();
            } else {
                // Chrome之类浏览器
                document.execCommand("insertText", false, text);
            }
        });
        // 去除Crtl+b/Ctrl+i/Ctrl+u等快捷键
        $(this).on('keydown', function (e) {
            // e.metaKey for mac
            if (e.ctrlKey || e.metaKey) {
                switch (e.keyCode) {
                    case 66: //ctrl+B or ctrl+b
                    case 98:
                    case 73: //ctrl+I or ctrl+i
                    case 105:
                    case 85: //ctrl+U or ctrl+u
                    case 117: {
                        e.preventDefault();
                        break;
                    }
                }
            }
        });
    });
</script>
<script>
    $("#buyer").autoComplete({
        url: server.ip + urlConfig.contractWyp.getNameAndTel,
        render: function (users, panel) {
            for (var i = 0; i < users.length; i++) {
                $("<li></li>").data("autoComplete",
                    users[i]).html("<a>" + users[i].customerName + "&nbsp;" +
                    "(" + users[i].customerTel + ") " + "</a>")
                    .appendTo(panel);
            }
        },
        selected: function (user) {
            app.contract.main.buyerId = user.customerId;
            app.contract.main.buyerTel = user.customerTel;
            app.contract.main.buyerTaxNo = user.idCard;
            app.contract.main.buyerAddress = user.buyerAddress;
            app.contract.main.buyer = user.customerName;
            return false;
        },
        extraParams: {createUserId: getCurrentUser().id},
        height: 210,
        width: 420
    });
</script>
</body>
</html>
